A 3D model virtual ornamentation drawing method and system
The 3D model virtual ornamentation method and system synchronize touchscreen drawings with 3D projections, addressing the lack of interactivity in existing 3D projection technologies by enabling real-time ornamentation on 3D models, thus enhancing visitor engagement.
Patent Information
- Application Number
- CN202210965613.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-12
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-08-12
AI Technical Summary
The existing 3D projection exhibition lacks human-computer interaction, and visitors can only enjoy unilateral viewing and cannot interact with the exhibition process.
By projecting the simulation model in the touch screen into a 3D model, and using detection points to judge the synchronization state of the simulation model and the 3D model, obtaining the touch signal to generate a virtual brush, drawing the simulation pattern in the simulation model, and projecting it to the 3D model in real time, real-time human-computer interaction is realized.
It improves the interactivity during the exhibition process and adds the fun of visitors. Through the real-time DIY drawing function, visitors interact with the 3D model.
Smart Images

Figure CN115239927B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D projection technology, and in particular, to a method and system for virtual ornamentation drawing of 3D models. Background Art
[0002] An exhibition hall is a public building used for displaying temporary exhibits. The traditional exhibition method is to place various exhibits in display cabinets for display, or to first construct a virtual model of the exhibit through software and then display the virtual model through a display screen for visitors to view.
[0003] However, with the development of technology, 3D projection technology has gradually been applied to exhibition halls. Through 3D projection technology, a virtual model can be projected into a 3D model. Compared with the 2D display through a display screen, the 3D model is more conducive to visitors' all-round viewing of special exhibits.
[0004] Regarding the above related technologies, the inventor believes that there are the following defects: In the 3D projection exhibition in the related technologies, it can only be used for one-way viewing by visitors, and there is no human-computer interaction during the exhibition process, resulting in poor interactivity. Summary of the Invention
[0005] In order to improve the defect that there is no human-computer interaction during the exhibition process of 3D projection exhibitions and the interactivity is poor, this application provides a method and system for virtual ornamentation drawing of 3D models.
[0006] In a first aspect, this application provides a method for virtual ornamentation drawing of 3D models, including the following steps:
[0007] Project the simulation model in the drawing area of the touch screen into a 3D model;
[0008] Based on the detection points preset on the surface of the simulation model, determine whether the simulation model and the 3D model are synchronized;
[0009] If the simulation model and the 3D model are synchronized, obtain a touch signal through the touch screen, and generate a virtual paintbrush in the drawing area based on the touch signal;
[0010] Save the drawing path of the virtual paintbrush and read the drawing parameters of the virtual paintbrush;
[0011] Generate a simulation ornamentation in the simulation model by combining the drawing path and the drawing parameters;
[0012] Project the simulation ornamentation onto the 3D model in real time.
[0013] By adopting the above technical solution, the simulation model in the touch screen is projected into a 3D model, and the synchronization between the simulation model and the 3D model is maintained. Visitors can draw on the simulation model through the touch screen. When the visitors operate the touch screen, touch signals will be generated. Based on the touch signals, the simulated patterns drawn by the visitors will be generated in the simulation model in real time, and the drawn simulated patterns will be projected onto the 3D model for presentation in real time. Through the touch screen and 3D projection, human-computer interaction is realized, the interactivity during the exhibition is improved, and a real-time DIY drawing function for the 3D model is added, which also adds the fun of visitors during the tour.
[0014] Optionally, the judging whether the simulation model and the 3D model are synchronized based on the detection points preset on the surface of the simulation model includes the following steps:
[0015] Project the detection points preset on the surface of the simulation model onto the 3D model to generate projection detection points located on the surface of the 3D model;
[0016] Rotate the simulation model based on a preset rotation angle, and record the rotation rate during the rotation process and the first rotation time used for the rotation process;
[0017] Draw two rotation paths of the detection points and the projection detection points during the rotation process;
[0018] Judge whether the distances of the two rotation paths are the same;
[0019] If the distances of the two rotation paths are different, it is determined that the simulation model and the 3D model are not synchronized;
[0020] If the distances of the two rotation paths are the same, then combine the rotation paths, the rotation rate, and the first rotation time to judge whether the simulation model and the 3D model are synchronized.
[0021] By adopting the above technical solution, since the simulation model and the 3D model are in the same proportion, if the simulation model and the 3D model are in a synchronized state, when the simulation model is rotated according to the preset rotation angle, the 3D model will also rotate by the same rotation angle, and the distance moved by any point on the simulation model should be the same as the distance moved by the projection point corresponding to this point on the 3D model. Therefore, it can be preliminarily judged whether the simulation model and the 3D model are synchronized by judging whether the distances of the detection points and the projection detection points are the same. When the distances are different, it can be determined that the simulation model and the 3D model are not synchronized.
[0022] Optionally, the combining the rotation paths, the rotation rate, and the first rotation time to judge whether the simulation model and the 3D model are synchronized includes the following steps:
[0023] Calculate a second rotation time based on the rotation rate and the rotation path of the projection detection point;
[0024] Determine whether the first rotation time and the second rotation time are the same;
[0025] If the first rotation time and the second rotation time are the same, it is determined that the simulation model and the 3D model are synchronized;
[0026] If the first rotation time and the second rotation time are different, it is determined that the simulation model and the 3D model are not synchronized.
[0027] By adopting the above technical solution, if the simulation model and the 3D model are in a synchronized state, the rotation rates of the simulation model and the 3D model during rotation should be the same, and the rotation times when rotating the same angle should also be the same. Therefore, the second rotation time of the projection detection point can be calculated through the rotation rate of the simulation model during rotation and the rotation path of the projection detection point, and then the first rotation time of the detection point is compared with the second rotation time of the projection detection point. If they are the same, it means that the simulation model and the 3D model are synchronized; if they are different, it means that the simulation model and the 3D model are not synchronized.
[0028] Optionally, after determining that the simulation model and the 3D model are not synchronized, the following steps are further included:
[0029] Judge whether the 3D model is complete through model integrity detection;
[0030] If the 3D model is incomplete, re-render the simulation model and project the rendered simulation model as a complete 3D model;
[0031] Replace the 3D model with the complete 3D model;
[0032] If the 3D model is complete, correct the projection delay when projecting the 3D model.
[0033] By adopting the above technical solution, after determining that the simulation model and the 3D model are not synchronized, the integrity of the 3D model can be detected first. If the 3D model is incomplete, it needs to be re-rendered and re-projected; if the 3D model is complete, it may be that the model is not synchronized due to projection delay. Therefore, the simulation model and the 3D model can be kept synchronized by correcting the projection delay.
[0034] Optionally, the steps of obtaining a touch signal through the touch screen and generating a virtual brush in the drawing area based on the touch signal include the following:
[0035] Generate a number of touch points in the drawing area based on the touch signal;
[0036] Determine that the number of touch points is one or more;
[0037] If the number of touch points is one, generate a virtual paintbrush at the position corresponding to the touch point in the drawing area;
[0038] If the number of touch points is multiple, obtain the generation times of all the touch points;
[0039] Select the touch point with the earliest generation time as the target touch point according to the generation time;
[0040] Generate a virtual paintbrush at the position corresponding to the target touch point in the drawing area.
[0041] By adopting the above technical solution, when the number of touch points is one, a virtual paintbrush can be directly generated at the position corresponding to the touch point in the drawing area. However, when the number of touch points is multiple, in order to avoid interference of multi-touch on the drawing process, a virtual paintbrush is only generated at the position of the target touch point with the earliest generation time, realizing single-touch.
[0042] Optionally, the drawing parameters include a paintbrush type and a parameter value. The paintbrush types include an embossing paintbrush and a carving paintbrush. The simulated patterns include embossing patterns and carving patterns. Generating the simulated pattern in the simulated model by combining the drawing path and the drawing parameters includes the following steps:
[0043] Determine that the paintbrush type is the embossing paintbrush or the carving paintbrush;
[0044] If the paintbrush type is the embossing paintbrush, calculate a first parameter value range based on the projection range and the model volume of the 3D model;
[0045] Adjust the parameter value based on the first parameter value range;
[0046] Generate the embossing pattern by combining the drawing path and the adjusted parameter value;
[0047] If the paintbrush type is the carving paintbrush, generate a second parameter value range based on the model thickness of the 3D model;
[0048] Adjust the parameter value based on the second parameter value range;
[0049] Generate the carving pattern by combining the drawing path and the adjusted parameter value.
[0050] By adopting the above technical solution, since the relief brush adds relief patterns on the basis of the original simulation model, while the carving brush will perform partial deletion and modification on the original simulation model, for the two different brush types, different parameter value ranges need to be calculated, and then the parameter values are adjusted according to the parameter value ranges, and finally the adjusted parameter values and the drawing path are combined to generate the simulation patterns corresponding to the brush types.
[0051] Optionally, the drawing parameters include the pattern type of the pattern, and the step of projecting the simulation pattern onto the 3D model in real time includes the following steps:
[0052] Locate the simulated modification area of the simulation pattern in the simulation model based on the drawing path;
[0053] Determine whether the simulation pattern is the relief pattern or the carving pattern;
[0054] If the simulation pattern is the relief pattern, generate a pattern model in the simulated modification area by combining the pattern type of the pattern and the drawing path;
[0055] Render the pattern model into a 3D pattern model through 3D real-time rendering;
[0056] Project the 3D pattern model onto the target area corresponding to the simulated modification area in the 3D model in real time;
[0057] If the simulation pattern is the carving pattern, modify the local simulation model located in the simulated modification area by combining the pattern type of the pattern and the drawing path;
[0058] Perform 3D real-time rendering on the local simulation model;
[0059] Project the rendered local simulation model onto the target area and replace the local 3D model at the target area.
[0060] By adopting the above technical solution, for the relief pattern, the relief pattern can be directly 3D real-time rendered into a 3D pattern model as an independent individual model, and then the 3D pattern model is projected onto the target area to complete the real-time 3D projection of the drawn pattern in the simulation model. For the carving pattern, the local simulation model located in the simulated modification area needs to be modified, and then the local simulation model is 3D real-time rendered. After the local rendering is completed, it is re-projected onto the target area and locally replaced. By local rendering and local replacement, the calculation amount during real-time rendering can be reduced, the rendering time can be shortened, thereby ensuring the timeliness of the modification synchronization between the simulation model and the 3D model.
[0061] In a second aspect, the present application further provides a 3D model virtual ornamentation drawing system, including a memory, a processor, and a program stored on the memory and executable on the processor. When the program is loaded and executed by the processor, it can implement a 3D model virtual ornamentation drawing method as described in the first aspect.
[0062] By adopting the above technical solution, through the retrieval of the program, the simulation model in the touch screen can be projected as a 3D model, and the synchronization between the simulation model and the 3D model can be maintained. The visitor can draw on the simulation model through the touch screen. When the visitor operates the touch screen, a touch signal will be generated. Based on the touch signal, the simulated ornamentation drawn by the visitor will be generated in the simulation model in real time, and the drawn simulated ornamentation will be projected onto the 3D model for presentation in real time. Through the touch screen and 3D projection, human-computer interaction is realized, the interactivity during the exhibition is improved, and a real-time DIY drawing function for the 3D model is also added, which also adds the interest of the visitor during the visit.
[0063] In summary, the present application includes the following beneficial technical effects:
[0064] The simulation model in the touch screen can be projected as a 3D model, and the synchronization between the simulation model and the 3D model can be maintained. The visitor can draw on the simulation model through the touch screen. When the visitor operates the touch screen, a touch signal will be generated. Based on the touch signal, the simulated ornamentation drawn by the visitor will be generated in the simulation model in real time, and the drawn simulated ornamentation will be projected onto the 3D model for presentation in real time. Through the touch screen and 3D projection, human-computer interaction is realized, the interactivity during the exhibition is improved, and a real-time DIY drawing function for the 3D model is also added, which also adds the interest of the visitor during the visit. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application.
[0066] Figure 2 is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application.
[0067] Figure 3 is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application.
[0068] Figure 4 is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application.
[0069] Figure 5 is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application.
[0070] Figure 6 It is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application.
[0071] Figure 7 It is a schematic flowchart of one implementation manner of the 3D model virtual ornamentation drawing method according to an embodiment of the present application. Specific implementation manner
[0072] The following will Figures 1 to 7 further describe the present application in detail with reference to the attached
[0073] An embodiment of the present application discloses a 3D model virtual ornamentation drawing method.
[0074] Referring to Figure 1 , the 3D model virtual ornamentation drawing method includes the following steps:
[0075] S101. Project the simulation model in the drawing area of the touch screen into a 3D model.
[0076] Among them, the touch screen for visitors to operate includes a toolbar and a drawing area. In the toolbar, there are pre-set virtual buttons for brush switching, multiple ornamentation patterns, and parameter value input boxes. In the drawing area, there is only a simulation model for drawing. The simulation model is created through 3D modeling software, and different types of simulation models can be created according to different types of exhibition halls. For example, in a historical exhibition hall, the simulation model can be created as a pottery pot. Visitors can click the virtual button for brush switching to switch the brush type for drawing, then click any one of the multiple ornamentation patterns to select as the ornamentation pattern to be drawn, and then input parameters such as brush width and brush depth in the parameter value input box, and then can perform ornamentation drawing on the simulation model in the drawing area. The simulation model in the drawing area can be projected into a 3D model in equal proportion through a 3D projector, and the real-time dynamic synchronization between the simulation model and the 3D model is maintained.
[0077] S102. Judge whether the simulation model and the 3D model are synchronized based on the detection points preset on the surface of the simulation model. If the simulation model and the 3D model are synchronized, then execute step S103.
[0078] Among them, the detection points can be projected onto the surface of the 3D model to form projected detection points, and then the simulation model is operated to move. After the simulation model moves, it can be judged whether the simulation model and the 3D model are synchronized through the movement trajectories and movement data of the detection points and the projected detection points.
[0079] S103. Obtain a touch signal through the touch screen, and generate a virtual brush in the drawing area based on the touch signal.
[0080] Among them, each time a visitor clicks on the screen, a touch signal is generated. When the touch signal appears in the drawing area, a virtual paintbrush will be generated and displayed at the front end of the touch screen.
[0081] S104. Save the drawing path of the virtual paintbrush and read the drawing parameters of the virtual paintbrush.
[0082] Among them, when the visitor clicks on the drawing area of the touch screen and slides, a continuous touch signal will be generated. At the first moment when the touch signal appears, a virtual paintbrush will be generated, and the continuous touch signal will generate a drawing path. The drawing parameters of the virtual paintbrush can be obtained by reading the parameters in the toolbar.
[0083] S105. Generate a simulated ornamentation in the simulation model by combining the drawing path and the drawing parameters.
[0084] Among them, the drawing path determines the length and shape of the simulated ornamentation, and the drawing parameters determine the properties such as the thickness and width of the simulated ornamentation.
[0085] S106. Project the simulated ornamentation onto the 3D model in real time.
[0086] Among them, the newly generated simulated ornamentation is projected onto the 3D model in equal proportion through a 3D projector.
[0087] The implementation principle of this embodiment is as follows:
[0088] The simulation model in the touch screen is projected as a 3D model, and the simulation model and the 3D model are kept synchronized. The visitor can draw on the simulation model through the touch screen. When the visitor operates the touch screen, a touch signal will be generated. Based on the touch signal, the simulated ornamentation drawn by the visitor will be generated in the simulation model in real time, and the drawn simulated ornamentation will be projected onto the 3D model for presentation in real time. Through the touch screen and 3D projection, human-computer interaction is realized, the interactivity in the exhibition process is improved, and a real-time DIY drawing function for the 3D model is also added, which also adds the fun of the visitor's tour.
[0089] In Figure 1 In step S102 of the illustrated embodiment, the detection points on the surface of the simulation model are projected onto the surface of the 3D model to form projected detection points. After rotating the simulation model, it is judged whether the simulation model and the 3D model are synchronized according to the relevant data during the movement process of the detection points and the projected detection points. Specifically, it is described in detail through the Figure 2 illustrated embodiment.
[0090] Referring to Figure 2 , judging whether the simulation model and the 3D model are synchronized based on the detection points preset on the surface of the simulation model includes the following steps:
[0091] S201. Project the detection points preset on the surface of the simulation model onto the 3D model to generate projected detection points on the surface of the 3D model.
[0092] Among them, the projected detection points exist in the form of special light points on the surface of the 3D model, and the brightness of the projected detection points is much greater than the overall brightness of the 3D model.
[0093] S202. Rotate the simulation model based on a preset rotation angle, and record the rotation rate during the rotation process and the first rotation time used in the rotation process.
[0094] Among them, the simulation model can be rotated through the background 3D modeling software. After inputting the rotation angle, the simulation model can be rotated horizontally or vertically. The rotation rate is the angular velocity of any point on the simulation model during the rotation process, and the first rotation time is the total time from the start of rotation to the end of rotation of the simulation model.
[0095] S203. Draw two rotation paths of the detection points and the projected detection points during the rotation process.
[0096] Among them, the 3D modeling software is used to capture the detection points and draw the rotation path of the detection points, while the projected detection points can be captured through the light point capture function of the 3D projector to capture the light and shadow detection points, and draw the rotation path of the projected detection points in the physical space.
[0097] S204. Determine whether the distances of the two rotation paths are the same. If the distances of the two rotation paths are different, execute step S205; if the distances of the two rotation paths are the same, execute step S206.
[0098] S205. Determine that the simulation model and the 3D model are not synchronized.
[0099] S206. Combine the rotation paths, rotation rate, and first rotation time to determine whether the simulation model and the 3D model are synchronized.
[0100] The implementation principle of this embodiment is as follows:
[0101] Since the simulation model and the 3D model are in the same proportion, if the simulation model and the 3D model are in a synchronized state, when the simulation model is rotated according to the preset rotation angle, the 3D model will also rotate the same rotation angle, and the distance moved by any point on the simulation model should be the same as the distance moved by the corresponding projection point on the 3D model. Therefore, by judging whether the distances of the detection points and the projected detection points are the same, it can be initially determined whether the simulation model and the 3D model are synchronized. When the distances are different, it can be determined that the simulation model and the 3D model are not synchronized.
[0102] In Figure 2In step S206 of the illustrated embodiment, when the distances are the same, the rotation times of the detection point and the projection detection point can be further compared, and whether the simulation model and the 3D model are synchronized can be determined according to the comparison result. Specifically, it will be described in detail through Figure 3 the illustrated embodiment.
[0103] Referring to Figure 3 , determining whether the simulation model and the 3D model are synchronized in combination with the rotation path, rotation rate, and first rotation time includes the following steps:
[0104] S301. Calculate a second rotation time according to the rotation rate and the rotation path of the projection detection point.
[0105] Among them, first calculate the rotation distance according to the rotation path of the projection detection point, and then divide the rotation distance by the rotation rate to calculate the second rotation time.
[0106] S302. Determine whether the first rotation time and the second rotation time are the same. If the first rotation time and the second rotation time are the same, execute step S303; if the first rotation time and the second rotation time are different, execute step S304.
[0107] S303. Determine that the simulation model and the 3D model are synchronized.
[0108] S304. Determine that the simulation model and the 3D model are not synchronized.
[0109] The implementation principle of this embodiment is as follows:
[0110] If the simulation model and the 3D model are in a synchronized state, the rotation rates of the simulation model and the 3D model during rotation should be the same, and the rotation times when rotating the same angle should also be the same. Therefore, the second rotation time of the projection detection point can be calculated through the rotation rate during the rotation of the simulation model and the rotation path of the projection detection point, and then the first rotation time of the detection point and the second rotation time of the projection detection point are compared. If they are the same, it means that the simulation model and the 3D model are synchronized; if they are different, it means that the simulation model and the 3D model are not synchronized.
[0111] In Figure 2 step S205 of the illustrated embodiment or Figure 3 step S304 of the illustrated embodiment, when the simulation model and the 3D model are not synchronized, the simulation model and the 3D model need to be synchronized and corrected. Specifically, it will be described in detail through Figure 4 the illustrated embodiment.
[0112] Referring to Figure 4 , after determining that the simulation model and the 3D model are not synchronized, the following steps are further included:
[0113] S401. Determine whether the 3D model is complete through model integrity detection. If the 3D model is incomplete, execute step S402; if the 3D model is complete, execute step S404.
[0114] Among them, the asynchronization between the simulation model and the 3D model may be caused by partial loss of the model during the rendering projection of the 3D model. Therefore, the simulation model can be used as an object sample, and the 3D model can be scanned as a whole through a 3D projector to detect the model integrity of the 3D model. If the scanning result is 100%, it is determined that the 3D model is complete; if it is not 100%, it is determined that the 3D model is incomplete.
[0115] S402. Re-render the simulation model and project the rendered simulation model as a complete 3D model.
[0116] S403. Replace the 3D model with the complete 3D model.
[0117] S404. Correct the projection delay when projecting the 3D model.
[0118] Among them, if the 3D model is complete, the asynchronization between the simulation model and the 3D model may also be caused by unstable communication connection between the touch screen and the 3D projector, resulting in a high projection delay. Therefore, the communication connection between the touch screen and the 3D projector can be re-established, and the connection status can be refreshed to adjust the projection delay to a lower level.
[0119] The implementation principle of this embodiment is as follows:
[0120] After determining that the simulation model and the 3D model are not synchronized, the model integrity of the 3D model can be detected first. If the 3D model is incomplete, it needs to be re-rendered and re-projected; if the 3D model is complete, the model asynchronization may be caused by the projection delay. Therefore, the simulation model and the 3D model can be kept synchronized by correcting the projection delay.
[0121] In Figure 1 In step S103 of the illustrated embodiment, touch points are generated according to the touch signal, and then virtual paintbrushes are generated based on the number of touch points. The state corresponding to single-touch needs to be maintained during the generation of virtual paintbrushes. Specifically, it is described in detail through the Figure 5 illustrated embodiment.
[0122] Referring to Figure 5 , obtaining the touch signal through the touch screen and generating virtual paintbrushes in the drawing area based on the touch signal includes the following steps:
[0123] S501. Generate a number of touch points in the drawing area based on the touch signal.
[0124] Among them, when a visitor clicks on the drawing area, a touch signal will be generated, and touch points will be generated at the positions corresponding to the drawing area according to the positions where the touch signals are generated. If only one person clicks with one finger, only one touch point will be generated. If multiple people click simultaneously or one person clicks with multiple fingers, multiple touch points will be generated.
[0125] S502. Determine whether the number of touch points is one or more. If the number of touch points is one, execute step S503; if the number of touch points is multiple, execute step S504.
[0126] S503. Generate a virtual paintbrush at the position corresponding to the touch point in the drawing area.
[0127] S504. Obtain the generation times of all touch points.
[0128] Among them, when the touch signal is generated, the system time at the time of signal generation will be synchronously recorded, and the recorded system time is the generation time of the corresponding touch point.
[0129] S505. Select the touch point generated earliest according to the generation time as the target touch point.
[0130] Among them, there is only one target touch point. If the touch signal corresponding to the target touch point persists, the target touch point will also persist. When the touch signal corresponding to the target touch point disappears, a new target touch point will be reselected according to the subsequent touch signals.
[0131] S506. Generate a virtual paintbrush at the position corresponding to the target touch point in the drawing area.
[0132] The implementation principle of this embodiment is as follows:
[0133] When the number of touch points is one, a virtual paintbrush can be directly generated at the position corresponding to the touch point in the drawing area. However, when the number of touch points is multiple, to avoid interference from multi-touch on the drawing process, a virtual paintbrush is only generated at the position of the earliest generated target touch point to achieve single-touch.
[0134] In Figure 1 In step S105 of the illustrated embodiment, the drawing parameters include the paintbrush type, the ornament pattern type, and the parameter value. The paintbrush type includes the relief paintbrush and the engraving paintbrush, the simulated ornaments include the relief ornaments and the engraving ornaments. Different parameter value ranges are determined according to the different paintbrush types, and then the parameter values are reasonably adjusted to reasonably generate the simulated ornaments. Specifically, it is described in detail through the Figure 6 illustrated embodiment.
[0135] Referring to Figure 6 , generating the simulated ornament in the simulation model in combination with the drawing path and the drawing parameters includes the following steps:
[0136] S601. Determine whether the brush type is a relief brush or a carving brush. If the brush type is a relief brush, then execute step S602; if the brush type is a carving brush, then execute step S605.
[0137] Among them, the determination is made based on the background data corresponding to the brush type in the toolbar.
[0138] S602. Calculate the first parameter value range based on the projection range of the 3D model and the model volume of the 3D model.
[0139] Among them, the first parameter value range is used to limit the thickness value of the ornamentation drawn by the relief brush. The projection range is the maximum projection range of the 3D projector. Import the maximum projection range into the 3D modeling software to generate a projection three-dimensional boundary. The 3D model is completely within the projection three-dimensional boundary, and the model beyond the projection three-dimensional boundary cannot be projected and imaged by the 3D projector. Calculate the shortest straight-line distance between each point on the surface of the 3D model and the projection three-dimensional boundary through the 3D modeling software, and then select the shortest straight-line distance M with the shortest distance from all the shortest straight-line distances. Then the first parameter value range is (0, M].
[0140] S603. Adjust the parameter value based on the first parameter value range.
[0141] Among them, the parameter value here is the thickness value of the ornamentation drawn by the relief brush. When the set parameter value exceeds the first parameter value range, the parameter value will be automatically adjusted to the preset reference value, and the reference value is within the first parameter value range.
[0142] S604. Generate a relief ornamentation by combining the drawing path and the adjusted parameter value.
[0143] S605. Generate a second parameter value range based on the model thickness of the 3D model.
[0144] Among them, the second parameter value range is used to limit the depth value of the ornamentation drawn by the carving brush. Assume that the model thickness of the 3D model is N, then the second parameter value range is (0, N].
[0145] S606. Adjust the parameter value based on the second parameter value range.
[0146] Among them, the parameter value here is the depth value of the ornamentation drawn by the carving brush. When the set parameter value exceeds the second parameter value range, the parameter value will be automatically adjusted to the preset reference value, and the reference value is within the second parameter value range.
[0147] S607. Generate a carving ornamentation by combining the drawing path and the adjusted parameter value.
[0148] The implementation principle of this embodiment is:
[0149] Since the relief brush adds relief patterns on the basis of the original simulation model, while the carving brush deletes and modifies parts of the original simulation model, for the two different types of brushes, different parameter value ranges need to be calculated, and then the parameter values are adjusted according to the parameter value ranges. Finally, the adjusted parameter values and the drawing path are combined to generate the simulated patterns corresponding to the brush types.
[0150] In Figure 1 In step S106 of the illustrated embodiment, according to different types of simulated patterns, the objects to be rendered and projected in real time are different, with the aim of reducing the time consumed by real-time rendering. Specifically, it is described in detail through Figure 7 the illustrated embodiment.
[0151] Referring to Figure 7 , projecting the simulated pattern onto the 3D model in real time includes the following steps:
[0152] S701. Locate the simulated modification area of the simulated pattern in the simulation model based on the drawing path.
[0153] S702. Determine whether the simulated pattern is a relief pattern or a carving pattern. If the simulated pattern is a relief pattern, execute step S703; if the simulated pattern is a carving pattern, execute step S706.
[0154] S703. Generate a pattern model in the simulated modification area by combining the pattern type and the drawing path.
[0155] S704. Render the pattern model into a 3D pattern model through 3D real-time rendering.
[0156] S705. Project the 3D pattern model onto the target area corresponding to the simulated modification area in the 3D model in real time.
[0157] S706. Combine the pattern type and the drawing path to modify the local simulation model located in the simulated modification area.
[0158] S707. Perform 3D real-time rendering on the local simulation model.
[0159] S708. Project the rendered local simulation model onto the target area and replace the local 3D model at the target area.
[0160] The implementation principle of this embodiment is:
[0161] For the relief decoration, the relief decoration can be directly 3D real-time rendered as an independent individual model into a 3D decoration model, and then the 3D decoration model is projected onto the target area, so as to complete the real-time 3D projection of the drawn decoration in the simulation model. For the engraved decoration, it is necessary to modify the local simulation model located in the simulated modification area, and then perform 3D real-time rendering on the local simulation model. After the local rendering is completed, it is re-projected onto the target area and locally replaced. Through local rendering and local replacement, the calculation amount during real-time rendering can be reduced, and the rendering time can be shortened, thereby ensuring the timeliness of the modification synchronization between the simulation model and the 3D model.
[0162] An embodiment of the present application also discloses a 3D model virtual decoration drawing system, including a memory, a processor, and a program stored on the memory and executable on the processor. When the program is loaded and executed by the processor, it can implement a 3D model virtual decoration drawing method as shown in Figures 1 to 7 the above.
[0163] The implementation principle of this embodiment is as follows:
[0164] By calling the program, the simulation model in the touch screen can be projected as a 3D model, and the simulation model and the 3D model can be kept synchronized. The visitor can draw on the simulation model through the touch screen. When the visitor operates the touch screen, a touch signal will be generated. Based on the touch signal, the simulated decoration drawn by the visitor will be generated in the simulation model in real time, and the drawn simulated decoration will be projected onto the 3D model for presentation in real time. Through the touch screen and 3D projection, human-computer interaction is realized, the interactivity during the exhibition is improved, and a real-time DIY drawing function for the 3D model is also added, which also adds the interest of the visitor during the visit.
[0165] The above are all the preferred embodiments of the present application. The protection scope of the present application is not limited by this. Therefore, all equivalent changes made according to the structure, shape, and principle of the present application should be covered within the protection scope of the present application.
Claims
1. A method for virtual ornamentation drawing of 3D models, characterized in that, It includes the following steps: Project the simulation model of the drawing area in the touch screen into a 3D model; Based on the detection points preset on the surface of the simulation model, determine whether the simulation model and the 3D model are synchronized; If the simulation model and the 3D model are synchronized, obtain a touch signal through the touch screen, and generate a virtual brush in the drawing area based on the touch signal; Save the drawing path of the virtual brush and read the drawing parameters of the virtual brush; Generate a simulated pattern in the simulation model by combining the drawing path and the drawing parameters; Project the simulated pattern onto the 3D model in real time; The determining whether the simulation model and the 3D model are synchronized based on the detection points preset on the surface of the simulation model includes the following steps: Project the detection points preset on the surface of the simulation model onto the 3D model to generate projection detection points located on the surface of the 3D model; Rotate the simulation model based on a preset rotation angle, and record the rotation rate during the rotation process and the first rotation time used for the rotation process; Draw two rotation paths of the detection points and the projection detection points during the rotation process; Judge whether the distances of the two rotation paths are the same; If the distances of the two rotation paths are different, it is determined that the simulation model and the 3D model are not synchronized; If the distances of the two rotation paths are the same, then combine the rotation paths, the rotation rate, and the first rotation time to judge whether the simulation model and the 3D model are synchronized.
2. The method for virtual ornament drawing of a 3D model according to claim 1, wherein The combining the rotation paths, the rotation rate, and the first rotation time to judge whether the simulation model and the 3D model are synchronized includes the following steps: Calculate a second rotation time according to the rotation rate and the rotation path of the projection detection point; Judge whether the first rotation time and the second rotation time are the same; If the first rotation time and the second rotation time are the same, it is determined that the simulation model and the 3D model are synchronized; If the first rotation time and the second rotation time are different, it is determined that the simulation model and the 3D model are not synchronized.
3. A method for virtual ornament painting of a 3D model according to claim 2, characterized in that, After determining that the simulation model and the 3D model are not synchronized, the following steps are further included: Judge whether the 3D model is complete through model integrity detection; If the 3D model is incomplete, re-render the simulation model and project the rendered simulation model into a complete 3D model; Replace the 3D model with the complete 3D model; If the 3D model is complete, correct the projection delay during the projection of the 3D model.
4. A method for virtual ornamentation drawing of a 3D model according to claim 1, characterized in that The obtaining a touch signal through the touch screen and generating a virtual brush in the drawing area based on the touch signal includes the following steps: Generate a number of touch points in the drawing area based on the touch signal; Judge whether the number of the touch points is one or more; If the number of the touch points is one, generate a virtual brush at the position corresponding to the touch point in the drawing area; If the number of the touch points is multiple, obtain the generation time of all the touch points; Select the earliest generated touch point as the target touch point according to the generation time; Generate a virtual paintbrush at the position corresponding to the target touch point in the drawing area.
5. A method for virtual ornament painting of a 3D model according to claim 1, characterized in that, The drawing parameters include a paintbrush type and parameter values. The paintbrush types include an embossing paintbrush and a carving paintbrush. The simulated patterns include embossing patterns and carving patterns. The steps of generating a simulated pattern in the simulated model by combining the drawing path and the drawing parameters are as follows: Determine whether the paintbrush type is the embossing paintbrush or the carving paintbrush; If the paintbrush type is the embossing paintbrush, calculate a first parameter value range based on the projection range of the 3D model and the model volume of the 3D model; Adjust the parameter values based on the first parameter value range; Generate the embossing pattern by combining the drawing path and the adjusted parameter values; If the paintbrush type is the carving paintbrush, generate a second parameter value range based on the model thickness of the 3D model; Adjust the parameter values based on the second parameter value range; Generate the carving pattern by combining the drawing path and the adjusted parameter values.
6. A method for virtual ornamentation drawing of a 3D model according to claim 5, characterized in that, The drawing parameters include a pattern type. The steps of projecting the simulated pattern onto the 3D model in real time are as follows: Locate the simulated modification area of the simulated pattern in the simulated model based on the drawing path; Determine whether the simulated pattern is the embossing pattern or the carving pattern; If the simulated pattern is the embossing pattern, generate a pattern model in the simulated modification area by combining the pattern type and the drawing path; Render the pattern model into a 3D pattern model through 3D real-time rendering; Project the 3D pattern model onto the target area corresponding to the simulated modification area in the 3D model in real time; If the simulated pattern is the carving pattern, modify the local simulated model located in the simulated modification area by combining the pattern type and the drawing path; Perform 3D real-time rendering on the local simulated model; Project the rendered local simulated model onto the target area and replace the local 3D model at the target area.
7. A 3D model virtual ornament painting system, characterized in that, It includes a memory, a processor, and a program stored on the memory and executable on the processor. When the program is loaded and executed by the processor, it can implement a 3D model virtual pattern drawing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Interactive three-dimensional setting system based on augmented reality
CN113126770A
Cultural relic surface ornamentation drawing method
CN113492617A