Rendering method of internal structure of model, storage medium and electronic equipment
By obtaining and rotating the sequence frame map of the virtual model and mapping it to the virtual billboard of the three-dimensional model for mixed rendering, the problem of internal construction of the mobile-side rendering virtual model is solved, and efficient rendering effect is achieved.
Patent Information
- Application Number
- CN202311658800.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, it is difficult to render virtual models with internal structures on the mobile terminal, and consume a large amount of terminal functions, making it difficult to achieve efficient rendering.
Mix renderings to reduce performance consumption by obtaining sequence frame maps of internal structural models, rotating the rendering image and mapping the target map to the virtual billboard of the 3D model.
It realizes the internal structure of efficient rendering of virtual models on the mobile terminal, reducing performance consumption during the rendering process.
Smart Images

Figure CN119295637A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual model rendering, and in particular to a rendering method, storage medium and electronic device for the internal structure of a model. Background Art
[0002] In the prior art, in a virtual three-dimensional scene, a virtual model can be created. The virtual model is a model created in a virtual scene by a computer and other hardware, and has a variety of uses, such as in games, movies, animations, metaverses, etc. If the virtual model is jade or ice, then in order to enhance the transparency of the jade or ice, it is hoped that the internal structure can be reflected in the material, and at the same time, for the sake of scene performance, it is hoped that translucency can be avoided. The current technology is to express the sense of transparency by performing parallax offset on the texture on the material. However, simple parallax offset cannot accurately express complex internal structures and dynamic effects, and complex parallax offset performance is relatively poor and cannot be used in large quantities on mobile terminals.
[0003] That is to say, in the prior art, if a virtual model with an internal structure is to be rendered on a mobile terminal, a large amount of terminal power will be consumed, which is difficult to achieve on a mobile terminal. Summary of the invention
[0004] The present application provides a rendering method, a storage medium and an electronic device for the internal structure of a model to solve the technical problem of difficulty in rendering the internal structure of a virtual model on a mobile terminal.
[0005] In a first aspect, the present application provides a method for rendering the internal structure of a model, comprising: obtaining a sequence frame map of the internal structure model, wherein the sequence frame map includes multiple rendered images, and each of the multiple rendered images is an image rendered after rotating the internal structure model once; mapping a target map in the sequence frame map to a virtual billboard of a three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target map is a map corresponding to the angle of the three-dimensional model relative to the virtual lens; and mixed rendering of the target map and the three-dimensional model.
[0006] As an optional example, the above-mentioned mixed rendering of the above-mentioned target map and the above-mentioned three-dimensional model includes: mixing the value of the alpha channel of the above-mentioned target map with the value of the alpha channel of the refractive part map of the above-mentioned three-dimensional model as a new refractive part map; mixing the reflective part map of the above-mentioned three-dimensional model with the new refractive part map to obtain the above-mentioned three-dimensional model after mixed rendering.
[0007] In a second aspect, the present application provides a rendering device for the internal structure of a model, which is used to implement the rendering method for the internal structure of the model when executed.
[0008] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned methods for rendering the internal structure of the model when executing the computer program.
[0009] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method for rendering the internal structure of the model described in any one of the above items of the present application.
[0010] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by obtaining a sequence frame map of the internal structure model, wherein the sequence frame map includes multiple rendered images, and each of the multiple rendered images is an image rendered after rotating the internal structure model once; mapping a target map in the sequence frame map to a virtual bulletin board of the three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target map is a map corresponding to the angle of the three-dimensional model relative to the virtual lens; and hybrid rendering of the target map and the three-dimensional model reduces performance consumption during the rendering process, and can be applied to a mobile terminal to render the internal structure of the three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0012] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0013] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0014] Figure 1 A flowchart of a method for rendering the internal structure of a model provided in an embodiment of the present application;
[0015] Figure 2 A photographed rendering image diagram of a rendering method for the internal structure of a model provided in an embodiment of the present application;
[0016] Figure 3 A photographed rendering image diagram of another method for rendering the internal structure of a model provided in an embodiment of the present application;
[0017] Figure 4 A virtual bulletin board schematic diagram of a method for rendering the internal structure of a model provided in an embodiment of the present application;
[0018] Figure 5 A system flow chart of a method for rendering the internal structure of a model provided in an embodiment of the present application;
[0019] Figure 6 A flowchart of a method for rendering the internal structure of a model provided in an embodiment of the present application;
[0020] Figure 7 A schematic diagram of the structure of a rendering device for the internal structure of a model provided in an embodiment of the present application;
[0021] Figure 8 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0023] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0024] In order to solve the technical problem that it is difficult to render the internal structure of a virtual model on a mobile terminal in the prior art, the present application provides a method for rendering the internal structure of a model, which can achieve the effect of rendering the internal structure of a virtual model on a mobile terminal.
[0025] Figure 1A flowchart of a method for rendering the internal structure of a model provided in an embodiment of the present application. Figure 1 As shown, the rendering method of the internal structure of the above model includes:
[0026] S102, obtaining a sequence frame map of the internal structure model, wherein the sequence frame map includes a plurality of rendered images, each of the plurality of rendered images being an image rendered after rotating the internal structure model once;
[0027] S104, mapping a target texture in the sequence frame texture to a virtual bulletin board of the three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target texture is a texture corresponding to an angle of the three-dimensional model relative to the virtual lens;
[0028] S106, blending the rendering target map and the three-dimensional model.
[0029] In this embodiment, the three-dimensional model is a virtual model constructed in a virtual scene, and the internal structure model is a model that is the same size and shape as the three-dimensional model, but the outer layer displays the internal structure of the three-dimensional model. For example, if the three-dimensional model is a cube made of stone, the internal structure model can be a model with stone materials pasted on the six faces of the cube, thereby displaying the internal structure of the three-dimensional model.
[0030] Sequence frame mapping is to use a virtual camera to take pictures of the internal structure model in the virtual scene, and rotate the internal structure model once for each picture, and the position of the virtual camera does not move, so as to take multiple rendered images. Alternatively, the internal structure model can be kept still, and each time the virtual camera takes a picture, it will render a certain angle around the internal structure model and take the next picture.
[0031] The virtual bulletin board is an area in a three-dimensional scene for displaying images or videos. In a three-dimensional scene, the virtual bulletin board can be a plane figure, and the area of the plane figure is the display area. On the virtual bulletin board, a rendered image can be displayed.
[0032] After the sequence frame texture is obtained by shooting, when rendering the 3D model, the 3D model and the target texture in the sequence frame texture are mixed and rendered. The target texture is the texture in the sequence frame texture that corresponds to the current position of the virtual camera relative to the 3D model. The target texture is placed on the virtual billboard.
[0033] The method provided by the embodiment of the present application obtains a sequence frame map of the internal structure model, wherein the sequence frame map includes multiple rendered images, and each of the multiple rendered images is an image rendered after rotating the internal structure model once; maps a target map in the sequence frame map to a virtual bulletin board of the three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target map is a map corresponding to the angle of the three-dimensional model relative to the virtual lens; and mixes the rendered target map with the three-dimensional model, thereby reducing performance consumption during the rendering process, and can be applied to a mobile terminal to render the internal structure of the three-dimensional model.
[0034] As an optional example, obtaining a sequence frame map of the internal structure model includes: controlling the internal structure model to rotate along the Z axis of the virtual coordinate system and rotating the target angle each time until the total rotation angle of the internal structure model reaches 360 degrees; rendering the internal structure model once each time the internal structure model rotates the target angle to obtain a rendered image; and determining the obtained multiple rendered images as a sequence frame map in which the target angle is a divisor of 360 degrees.
[0035] In this embodiment, the internal structure model is rotated once, and an image is taken. For example, Figure 2 As shown, Figure 2 The internal structure model 202 and the virtual camera 204 are included. The internal structure model 202 can rotate along the Z axis. Each time it rotates a target angle, the virtual camera 204 renders an image as a rendered image each time it rotates.
[0036] In this embodiment, the virtual camera and the internal structure model can be on the same horizontal plane, such as the center of the virtual camera and the center of the internal structure model are located on a plane parallel to the X-axis and the Y-axis, that is, Figure 2 The appearance in the figure can also have a certain angle, such as Figure 3 As shown, the virtual camera 302 shoots the internal structure model 202 at a certain depression angle or elevation angle, and the internal structure model 202 rotates along the Z axis 206. Whether the virtual camera and the internal structure model include a depression angle or an elevation angle can be determined according to whether the virtual camera includes a depression angle or an elevation angle relative to the three-dimensional model corresponding to the internal structure model when the three-dimensional model is actually used.
[0037] In this embodiment, each time the internal structure model is rotated, the rotation angle is N degrees, and the rotation is performed with the Z axis as the rotation axis. The rotation N degrees is a divisor of 360 degrees, so when rotating 360 / N, it can rotate exactly one circle. After rotating one circle, 360 / N number of sequential frame images are obtained.
[0038] As an optional example, the internal structure model is rendered once each time the internal structure model is rotated by a target angle to obtain a rendered image, which includes: each time the internal structure model is rotated, the internal structure model is rendered once from the front of the internal structure model using an orthogonal camera; and the model color and depth of the internal structure model rendered by the orthogonal camera are saved as a picture to obtain a rendered image.
[0039] In this embodiment, the virtual camera is an orthogonal camera, and the orthogonal camera is fixed and the internal structure model is rotated to render the internal structure model using the orthogonal camera to obtain a rendered image. When rotating the internal structure model, the Z axis is used as the rotation axis, and each rotation is a fixed angle. After one rotation, the internal structure model is fixed, and the orthogonal camera is used to render the model color and depth. After rendering to obtain an image, the internal structure model is continued to be rotated.
[0040] As an optional example, before mapping a target map in a sequence frame map to a virtual billboard of a three-dimensional model, the method further includes: determining a virtual billboard based on a position of the three-dimensional model in a virtual coordinate system and a line of sight of a virtual lens in the virtual coordinate system, wherein the virtual billboard always faces the virtual lens; and determining a target map from the sequence frame map.
[0041] In this embodiment, the virtual billboard is located between the virtual lens and the 3D model. When the 3D model is viewed through the virtual lens, the virtual billboard is first seen, followed by the 3D model. Therefore, the target texture can be displayed through the virtual billboard, thereby achieving mixed rendering of the target texture and the 3D model. For example, Figure 4 As shown, Figure 4 In the example, the virtual billboard 402 is located between the virtual camera and the three-dimensional model, and the target map is displayed on the virtual billboard 402 .
[0042] As an optional example, determining a target texture from a sequence frame texture includes: determining a rotation angle of each texture in the sequence frame texture when it is generated; determining a sorting order of each texture in the sequence frame texture based on the rotation angle; determining a camera angle of a virtual camera relative to a three-dimensional model; and determining a target texture based on the camera angle and the sorting order.
[0043] In this embodiment, it is possible to first determine how many degrees the internal structure model rotates when each map in the sequence frame map is generated. Because the internal structure model is rotated at a certain angle to generate a map, the order of the maps can be determined by the rotation angle of the internal structure model. The maps are sorted in order and stored in the sequence frame map, and each map corresponds to an angle of rotation of the internal structure model. When the target map is to be determined, the camera angle of the virtual camera relative to the three-dimensional model is checked, and then the corresponding target map is searched from the sequence frame map according to the camera angle.
[0044] As an optional example, determining the camera angle of the virtual camera relative to the three-dimensional model includes: determining a reference axis on a plane perpendicular to the Z axis, wherein the starting point of the reference axis is the center of a circle of the virtual coordinate system; and determining the angle between a line segment from the center of the circle to the virtual camera and the reference axis as the camera angle.
[0045] In this embodiment, a reference axis can be determined first, and then the angle between the line connecting the virtual camera and the center of the circle and the reference axis can be checked, and the angle is the camera angle. Figure 5 As shown, Figure 5 In the figure, 502 is the Z axis, and the circle 504 is a circle on a plane perpendicular to the Z axis. The virtual camera 508 is located at a point on the original. The reference axis is a ray from the center of the circle to any point on the circle, such as Figure 5 The angle formed by the ray, the center of the circle and the line segment of the camera 508 is the camera angle. If the 3D model is rotated, the reference axis will rotate with the rotation of the 3D model. If the virtual camera does not move, the angle will change. If the 3D model does not move, the virtual camera rotates around the 3D model, such as Figure 5 The circle in is the trajectory of the virtual camera. The lens of the virtual camera always faces the 3D model, so the camera angle will also change.
[0046] As an optional example, determining the target map based on the camera angle and the sorting order includes: comparing the camera angle with the difference in rotation angles between two adjacent maps to obtain a ratio; determining the integer part of the ratio as a sequence value; and determining the sequence value-th map in the sequence frame map as the target map.
[0047] In this embodiment, in the process of obtaining the sequence frame map, the rendered images in the sequence frame map can be numbered. For example, when the virtual camera renders the 3D model to obtain a rendered image, the rendered image can be numbered as 0, and then the 3D model is rotated. After the 3D model is rotated, the virtual camera renders the 3D model again to obtain the second rendered image, which is numbered as 1. Each time the 3D model rotates 30 degrees, 12 rendered images are obtained after 11 rotations. After the 12th rotation, it rotates a full circle, and the 12th rotation does not need to be rendered because the rendered image is the same as the rendered image numbered 0.
[0048] When using a virtual camera to render a 3D model, the camera angle of the virtual camera can be obtained, and the camera angle can be compared with the difference in rotation angles between two adjacent maps. For example, the camera angle is 120 degrees, and the difference in rotation angles between two adjacent maps is 30 degrees (so there are 12 sequence frame maps), 120 / 30=4, so the map numbered 4 in the sequence frame map is used as the target map (because when rendering the sequence frame map, an image will be rendered when the camera angle is 0, so the number of the first rendered image is 0, ensuring that the 4 obtained by calculating 120 / 30=4 is the number in the sequence frame map, and the corresponding image can be found).
[0049] As an optional example, after mixed rendering of the target map and the three-dimensional model, the above method also includes: saving the mixed rendering result of the target map and the three-dimensional model as a material resource; after each rendered image in the sequence frame map is mixed with the three-dimensional model, saving the obtained multiple material resources as an internal structure material package of the three-dimensional model.
[0050] In this embodiment, when the target map and the three-dimensional model are mixed and rendered, the mixed rendering result of the two can be saved as a material resource. The material resource is used as the internal structure material of the three-dimensional model. The internal structure materials at various angles are merged into an internal structure material package. The internal structure material package can be downloaded or saved for use when displaying the three-dimensional model.
[0051] For example, Figure 4 The virtual camera 204 and the billboard 402 in the figure have a target map on the billboard 402. Therefore, when the virtual camera 204 renders the 3D model 202 through the billboard 402, the target map on the billboard 402 is Figure 1 Rendering starts. The target map is overlapped with the three-dimensional model and rendered into a material package. The material package is a mixture of the external and internal structures of the three-dimensional model 202 captured when the virtual camera 204 captures the three-dimensional model 202 at a certain angle. The mixed image is used as a material resource in the material package. The material resource is the external structure and internal structure of the three-dimensional model seen when observing the three-dimensional model 202 from the perspective of the virtual camera 204. After the texture of each angle is rendered to obtain the material resource (taking the rendering every 30 degrees in the above example as an example, a total of 12 material resources are obtained), the 12 material resources are packaged into a material package. Then, the mobile terminal can directly download the material package. When the three-dimensional model is displayed on the mobile terminal, the external structure and internal structure of the three-dimensional model can be displayed by displaying the material resources in the material package.
[0052] As an optional example, blending the rendering target map and the three-dimensional model includes: blending the value of the alpha channel of the target map with the value of the alpha channel of the refractive part map of the three-dimensional model as a new refractive part map; blending the reflective part map of the three-dimensional model with the new refractive part map to obtain a blended rendered three-dimensional model.
[0053] In this embodiment, when the three-dimensional model and the target map are mixed and rendered, the target map and the refraction part map of the three-dimensional model can be alpha-blended to form a new refraction part map. The alpha blending in this embodiment can be to collect the color value of the target map and the value of the alpha channel, and collect the color value of the refraction part map of the three-dimensional model, and use 1 minus the alpha channel value of the target map to obtain the value as the alpha channel value of the refraction part, and then multiply the color value of the target map and the color value of the refraction part map of the three-dimensional model by their respective alpha channel values, and then add the multiplication results to form a new refraction part map. The formula is expressed as:
[0054] Target map color value * target map alpha channel value + refraction map color value * (1-target map alpha channel value).
[0055] The reflection part map of the 3D model is mixed with the new refraction part map to obtain the 3D model after hybrid rendering. The rendering result of the hybrid rendering can include both the appearance of the 3D model and the internal structure of the 3D model (the internal structure is provided by the target map), thereby achieving the effect of displaying the internal structure of the 3D model.
[0056] Figure 6 This is a flow chart of the method for rendering the internal structure of the model of this embodiment. First, S602, build the internal structure model, then S604, use the orthogonal camera to render the model from the front of the model, and save the rendered model color and depth as a rendering map, then S606, rotate the internal structure model with the Z axis as the rotation axis, and render the internal structure model once each rotation. If the rotation is less than 360 degrees, then S608, continue to rotate and render, until S610, the total rotation angle of the internal structure model reaches 360 degrees, and the multiple rendering maps obtained by rendering are synthesized into a sequence frame map. S612, according to the position and viewing direction of the three-dimensional model, calculate a virtual billboard that always faces the camera, S614, select the target map of the corresponding angle from the sequence frame map according to the line of sight angle, and map it to the virtual billboard, S616, mix and render the target map of the virtual billboard and the original material effect of the three-dimensional model to obtain a rendered three-dimensional model.
[0057] Figure 7 A schematic diagram of a structure of a rendering device for the internal structure of a model provided in an embodiment of the present application. Figure 7As shown, the rendering device of the internal structure of the above model includes:
[0058] An acquisition module 702 is used to acquire a sequence frame map of the internal structure model, wherein the sequence frame map includes a plurality of rendered images, and each of the plurality of rendered images is an image rendered after rotating the internal structure model once;
[0059] A mapping module 704 is used to map a target texture in the sequence frame texture to a virtual bulletin board of the three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target texture is a texture corresponding to the angle of the three-dimensional model relative to the virtual lens;
[0060] The rendering module 706 is used for mixed rendering of the target texture and the 3D model.
[0061] In this embodiment, the three-dimensional model is a virtual model constructed in a virtual scene, and the internal structure model is a model that is the same size and shape as the three-dimensional model, but the outer layer displays the internal structure of the three-dimensional model. For example, if the three-dimensional model is a cube made of stone, the internal structure model can be a model with stone materials pasted on the six faces of the cube, thereby displaying the internal structure of the three-dimensional model.
[0062] Sequence frame mapping is to use a virtual camera to take pictures of the internal structure model in the virtual scene, and rotate the internal structure model once for each picture, and the position of the virtual camera does not move, so as to take multiple rendered images. Alternatively, the internal structure model can be kept still, and each time the virtual camera takes a picture, it will render a certain angle around the internal structure model and take the next picture.
[0063] The virtual bulletin board is an area in a three-dimensional scene for displaying images or videos. In a three-dimensional scene, the virtual bulletin board can be a plane figure, and the area of the plane figure is the display area. On the virtual bulletin board, a rendered image can be displayed.
[0064] After the sequence frame texture is obtained by shooting, when rendering the 3D model, the 3D model and the target texture in the sequence frame texture are mixed and rendered. The target texture is the texture in the sequence frame texture that corresponds to the current position of the virtual camera relative to the 3D model. The target texture is placed on the virtual billboard.
[0065] The method provided by the embodiment of the present application obtains a sequence frame map of the internal structure model, wherein the sequence frame map includes multiple rendered images, and each of the multiple rendered images is an image rendered after rotating the internal structure model once; maps a target map in the sequence frame map to a virtual bulletin board of the three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target map is a map corresponding to the angle of the three-dimensional model relative to the virtual lens; and mixes the rendered target map with the three-dimensional model, thereby reducing performance consumption during the rendering process, and can be applied to a mobile terminal to render the internal structure of the three-dimensional model.
[0066] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.
[0067] like Figure 8 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0068] Memory 113, used for storing computer programs;
[0069] In one embodiment of the present application, the processor 111 is used to implement the rendering method of the internal structure of the model provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.
[0070] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of a method for rendering the internal structure of a model provided in any of the aforementioned method embodiments are implemented.
[0071] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0073] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0074] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for rendering the internal structure of a model, characterized in that: include: Acquire a sequence frame map of the internal structure model, wherein the sequence frame map includes a plurality of rendered images, and each of the plurality of rendered images is an image rendered after rotating the internal structure model once; Mapping a target texture in the sequence frame texture onto a virtual bulletin board of a three-dimensional model, wherein the three-dimensional model is a model of the same size and shape as the internal structure model, and the target texture is a texture corresponding to an angle of the three-dimensional model relative to the virtual lens; The target map and the three-dimensional model are mixed and rendered.
2. The method according to claim 1, characterized in that The obtaining of the sequence frame maps of the internal structure model comprises: Controlling the internal structure model to rotate along the Z axis of the virtual coordinate system and rotating by a target angle each time until the total rotation angle of the internal structure model reaches 360 degrees; Each time the internal structure model rotates by the target angle, the internal structure model is rendered once to obtain a rendered image; The obtained multiple rendering images are determined as the sequence frame map, wherein the target angle is a divisor of the 360 degrees.
3. The method according to claim 2, characterized in that The rendering of the internal structure model once each time the internal structure model rotates the target angle to obtain a rendered image comprises: Each time the internal structure model is rotated once, the internal structure model is rendered once from the front side of the internal structure model using an orthographic camera; The model color and depth of the internal structure model rendered by the orthogonal camera are saved as a picture to obtain the rendered image.
4. The method according to claim 1, characterized in that: Before mapping a target texture in the sequence frame texture onto the virtual bulletin board of the three-dimensional model, the method further includes: Determining the virtual bulletin board according to the position of the three-dimensional model in the virtual coordinate system and the sight direction of the virtual lens in the virtual coordinate system, wherein the virtual bulletin board always faces the virtual lens; The target map is determined from the sequence frame maps.
5. The method according to claim 4, characterized in that Determining the target map from the sequence frame map comprises: Determining the rotation angle of each texture in the sequence frame texture when it is generated; According to the rotation angle, determining the sorting order of each of the maps in the sequence frame maps; determining a camera angle of a virtual camera relative to the three-dimensional model; The target map is determined according to the camera angle and the sorting order.
6. The method according to claim 5, characterized in that Determining the camera angle of the virtual camera relative to the three-dimensional model comprises: On a plane perpendicular to the Z axis, determine a reference axis, wherein the starting point of the reference axis is the center of the virtual coordinate system; The angle between the line segment from the center of the circle to the virtual camera and the reference axis is determined as the camera angle.
7. The method according to claim 5, characterized in that Determining the target map according to the camera angle and the sorting order includes: Compare the camera angle with the difference in rotation angles between two adjacent maps to obtain a ratio; determining an integer portion of the ratio as an ordinal value; The sequence value-th texture in the sequence frame texture is determined as the target texture.
8. The method according to claim 4, characterized in that After hybrid rendering of the target map and the three-dimensional model, the method further includes: Saving a mixed rendering result of the target texture and the three-dimensional model as a material resource; After each rendered image in the sequence frame map is mixed with the three-dimensional model and rendered, the obtained multiple material resources are saved as an internal structure material package of the three-dimensional model.
9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor implements the method described in any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method according to any one of claims 1 to 8 of the present application.