Model automatic generation method and device, computer device, and storage medium
By generating and adjusting model planes in 3D space, cutting and rendering textures, the problem of complex and error-prone pixelated model creation is solved, achieving efficient and accurate automatic model generation.
Patent Information
- Application Number
- CN202111545404.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-12-16
AI Technical Summary
The existing technology for creating pixelated models suffers from problems such as high computational cost, cumbersome steps, and susceptibility to errors.
By acquiring the original artwork image and model texture, a model plane is created in 3D space based on the model view, and its relative position is adjusted to generate intersecting models. The vertex texture coordinates are then cut and determined, and finally the texture is rendered on the model surface to form the target model.
It simplifies the model making process, reduces time costs, improves production efficiency, and effectively avoids production errors.
Smart Images

Figure CN114266849B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of model generation, in particular to a model automatic generation method and device, computer equipment and a storage medium. BACKGROUND
[0002] Pixels are composed of color blocks one by one. Pixelization, as the name implies, is to divide an image into certain areas and convert these areas into corresponding color blocks, and then form a pattern from the color blocks. There are some pixelated games on the market, and there is a wide demand for pixelated model production. However, some pixelated model production schemes in the prior art have problems such as large amount of calculation, complicated steps, and easy to make mistakes. SUMMARY
[0003] The embodiments of the present application provide a model automatic generation method and device, computer equipment and a storage medium, which can simplify the production steps of the model, reduce the time cost of the model production, improve the efficiency of the model production, and avoid errors in the model production.
[0004] The embodiments of the present application provide a model automatic generation method, comprising:
[0005] Obtaining a sketch image used for generating a target model and a model texture of the target model, the sketch image comprising at least two model views of the target model obtained from different viewing angles;
[0006] Creating a model plane corresponding to each of the model views in a three-dimensional space based on each of the model views;
[0007] Adjusting the relative positions of each of the model planes based on the viewing angles of each of the model views, so that the relative positions between each of the model planes match the relative positions of each of the model views on the target model;
[0008] Generating an intersecting silhouette model in the three-dimensional space according to the relative positions of each of the model planes and each of the model planes, and obtaining an intersection part of each of the intersecting silhouette models to form an intersecting model;
[0009] Cutting the intersecting model to determine the vertex texture coordinates of the cut intersecting model;
[0010] Rendering a corresponding model texture on the surface of the intersecting model based on the vertex texture coordinates to form the target model.
[0011] Correspondingly, the embodiments of the present application also provide a model automatic generation device, comprising:
[0012] The acquisition unit is configured to acquire a sketch image used for generating a target model and a model map of the target model, the sketch image comprising at least two model views of the target model taken from different perspectives;
[0013] The creating unit is configured to create a model plane corresponding to each of the model views in a three-dimensional space based on each of the model views;
[0014] The adjusting unit is configured to adjust a relative position of each of the model planes based on a viewing perspective of each of the model views, so that the relative positions among the model planes match relative positions of the model views on the target model;
[0015] The intersecting unit is configured to generate intersecting silhouette models in the three-dimensional space according to the relative positions of the model planes and the model planes, and to acquire an intersection part of each of the silhouette models to form an intersection model;
[0016] The cutting unit is configured to cut the intersection model and determine vertex texture coordinates of the cut intersection model;
[0017] The rendering unit is configured to render a corresponding model map on a surface of the intersection model based on the vertex texture coordinates to form the target model.
[0018] Optionally, the model views comprise a front view, a side view and a top view, the sketch image comprises at least three sub-images, the three sub-images are located in a top-left corner region, a top-right corner region, a bottom-left corner region and a bottom-right corner region of the sketch image respectively, and the method is further configured to:
[0019] Acquire a preset positional relationship of each of the model views in the sketch image;
[0020] Determine, based on the preset positional relationship, that a sub-image located in the top-left corner region of the sketch image is the front view;
[0021] Determine, based on the preset positional relationship, that a sub-image located in the top-right corner region of the sketch image is the side view;
[0022] Determine, based on the preset positional relationship, that a sub-image located in the bottom-right corner region of the sketch image is the top view.
[0023] Optionally, the creating unit is further configured to:
[0024] Create a candidate plane corresponding to each of the model views in the three-dimensional space based on pixels in each of the model views, the candidate plane comprising a plurality of sub-planes, wherein one pixel corresponds to one sub-plane in the candidate plane;
[0025] determining a corresponding to-be-processed sub-plane of a transparent pixel in the model view in the candidate plane;
[0026] culling the to-be-processed sub-plane in the candidate plane to form the model plane.
[0027] Optionally, the creating unit is further configured to:
[0028] convert a data node type of the model plane from a graph type to a polygon type.
[0029] Optionally, the intersecting unit is further configured to:
[0030] perform an extrusion operation on each of the model planes at a relative position of each of the model planes to generate a corresponding silhouette model of each of the model planes in the three-dimensional space;
[0031] move at least one of the silhouette models so that each of the silhouette models intersects in the three-dimensional space;
[0032] obtain an intersecting part of each of the silhouette models to form the intersecting model.
[0033] Optionally, the intersecting unit is further configured to:
[0034] determine an extension width of each of the model planes extending to a corresponding silhouette model according to a number of pixels of each of the model views;
[0035] perform an extrusion operation on each of the model planes based on the corresponding extension width of each of the model planes to generate a corresponding silhouette model of each of the model planes in the three-dimensional space.
[0036] Optionally, the three-dimensional space includes a preset bottom surface and a preset origin point located on the preset bottom surface, and the intersecting unit is further configured to:
[0037] move at least one of the silhouette models so that a projection point of a center point of each of the silhouette models on the preset bottom surface coincides with the preset origin point.
[0038] Optionally, the intersecting unit is further configured to:
[0039] determine at least two to-be-merged vertices with same coordinates in the intersecting model;
[0040] merge the at least two to-be-merged vertices into one vertex of the intersecting model.
[0041] Optionally, the intersecting unit is further configured to:
[0042] determine a missing plane in the intersecting model;
[0043] Supplement the missing plane in the intersection model.
[0044] Optionally, the intersection unit is further configured to:
[0045] Determine redundant topologies in the intersection model.
[0046] Eliminate the redundant topologies.
[0047] Optionally, the cutting unit is further configured to:
[0048] Determine boundaries of each plane in the intersection model, cut the intersection model according to the boundaries, and obtain a plurality of cut planes.
[0049] Obtain a pixel reference size of the model map.
[0050] Divide each cut plane into a plurality of polygon meshes of the pixel reference size.
[0051] Determine vertex texture coordinates of the cut plane based on vertex coordinates of the intersection model, face normals formed by the vertices, and each polygon mesh.
[0052] Optionally, the rendering unit is further configured to:
[0053] Arrange each polygon mesh non-overlapping and adjacent to obtain an arranged mesh.
[0054] Determine a rendering position of at least one model map on the intersection model based on the vertex texture coordinates.
[0055] Render a corresponding model map on a surface of the intersection model based on the rendering position and the arranged mesh to form the target model.
[0056] Optionally, the rendering unit is further configured to:
[0057] Set that the surface of the target model is composed of triangular meshes.
[0058] Similarly, the embodiment of the present application also provides a computer device, comprising:
[0059] A memory for storing a computer program.
[0060] A processor for executing steps of any one of the model automatic generation methods.
[0061] In addition, the embodiment of the present application also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement steps of any one of the model automatic generation methods.
[0062] The embodiment of the present application provides a model automatic generation method and device, computer equipment and a storage medium. After a model making software on a terminal acquires a sketch image used for generating a target model and a model map of the target model, when a model generation instruction is received, corresponding model planes can be automatically generated according to each model view in the sketch image, an intersecting model is further generated, vertex texture coordinates of the intersecting model are automatically acquired, finally, the model map is rendered on a surface of the intersecting model based on the vertex texture coordinates, and the target model is generated, so that the software can automatically generate the model, the model making steps are simplified, the time cost of model making is reduced, the efficiency of model making is improved, and the software making is performed according to the set standardized instruction, so that the errors in model making can be greatly avoided. BRIEF DESCRIPTION OF DRAWINGS
[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0064] Figure 1 FIG. 1 is a system schematic diagram of a model automatic generation device provided by the embodiment of the present application;
[0065] Figure 2 FIG. 2 is a flow schematic diagram of a model automatic generation method provided by the embodiment of the present application;
[0066] Figure 3 FIG. 3 is a sketch image provided by the embodiment of the present application;
[0067] Figure 4 FIG. 4 is a model plane schematic diagram provided by the embodiment of the present application;
[0068] Figure 5 FIG. 5 is a model plane schematic diagram after adjustment provided by the embodiment of the present application;
[0069] Figure 6 FIG. 6 is a model plane schematic diagram of a front view provided by the embodiment of the present application;
[0070] Figure 7 FIG. 7 is a silhouette model schematic diagram provided by the embodiment of the present application;
[0071] Figure 8 FIG. 8 is a silhouette model intersection schematic diagram provided by the embodiment of the present application;
[0072] Figure 9 FIG. 9 is an intersecting model schematic diagram provided by the embodiment of the present application;
[0073] Figure 10is a schematic diagram provided by an embodiment of the present application after topology cleaning;
[0074] Figure 11 is a schematic diagram of a cutting plane provided by an embodiment of the present application;
[0075] Figure 12 is another flowchart of a model automatic generation method provided by an embodiment of the present application;
[0076] Figure 13 is a structural schematic diagram of a model automatic generation apparatus provided by an embodiment of the present application;
[0077] Figure 14 is a structural schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0078] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person skilled in the art without creative work fall within the protection scope of the present application.
[0079] The present application provides a model automatic generation method, apparatus, computer device and storage medium. Specifically, the model automatic generation method of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server and the like. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, a personal computer (PC), a personal digital assistant (PDA) and the like, and the terminal can also include a client, which can be a model generation software application client, a browser client carrying a model generation software program or an instant messaging client and the like. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution network services, and basic cloud computing services such as big data and artificial intelligence platforms.
[0080] For example, when the model automatic generation method is run on a terminal, the terminal device stores the model generation software application and is used to present the scene in the model generation picture. The terminal device is used to interact with the user through a graphical user interface, for example, by downloading and installing the model generation software application on the terminal device and running it. The terminal device can provide the graphical user interface to the user in various ways, for example, it can be rendered and displayed on the display screen of the terminal device, or the graphical user interface can be presented by holographic projection. For example, the terminal device can include a touch display screen and a processor, the touch display screen is used to present the graphical user interface and receive the operation instructions generated by the user acting on the graphical user interface, the graphical user interface includes the model generation picture, and the processor is used to run the model generation software application, generate the graphical user interface, respond to the operation instructions, and control the display of the graphical user interface on the touch display screen.
[0081] For example, when the model automatic generation method is run on a server, the model can be automatically generated by using the cloud. In the running mode of generating the model by using the cloud, the running subject of the model generation software application and the presentation subject of the model generation picture are separated, and the storage and running of the model automatic generation method are completed on the cloud server. The presentation of the model generation picture is completed on the client of the cloud server, and the client of the cloud server is mainly used for receiving and sending the software automatic generation data and presenting the model generation picture. For example, the cloud client can be a display device close to the user side with data transmission function, such as a mobile terminal, a computer, a palm computer, a personal digital assistant, etc., but the terminal device for processing the model automatic generation data is the cloud server of the cloud. When the model automatic generation is performed, the user operates the client to send the operation instruction to the cloud server, the cloud server runs the model generation software program according to the operation instruction, encodes and compresses the model generation picture and other data, returns the data to the cloud client through the network, and finally decodes and outputs the model generation picture through the cloud client.
[0082] Please refer to Figure 1 , Figure 1A system schematic diagram of a model automatic generation device provided by an embodiment of the present application is provided. The system can include at least one terminal. The terminal is configured to acquire a sketch image used for generating a target model and a model map of the target model, the sketch image including at least two model views of the target model from different perspectives; create a model plane corresponding to each model view in a three-dimensional space based on each model view; adjust the relative positions of the model planes based on the viewing perspectives of each model view, so that the relative positions between the model planes match the relative positions of the model views on the target model; generate intersecting silhouette models in the three-dimensional space according to the relative positions of the model planes and the model planes, acquire an intersection part of each silhouette model to form an intersection model; cut the intersection model to determine the vertex texture coordinates of the cut intersection model; render the corresponding model map on the surface of the intersection model based on the vertex texture coordinates to form the target model.
[0083] The following will be described in detail. It should be noted that the order of the following embodiments is not limited as the preferred order of the embodiments.
[0084] The embodiment will be described from the perspective of a model automatic generation device, which can be integrated in a terminal device, such as a smart phone, a notebook computer, a tablet computer, a personal computer, and the like.
[0085] The model automatic generation method provided by the embodiment of the present application can be executed by a processor of a terminal, as shown in the following Figure 2 The specific process of the model automatic generation method mainly includes steps 201 to 206, which are described in detail as follows.
[0086] In step 201, a sketch image used for generating a target model and a model map of the target model are acquired, the sketch image including at least two model views of the target model from different perspectives.
[0087] In the embodiment of the present application, a technician inputs the sketch image into a model making software installed in the terminal, creates a window for generating a target model corresponding to the sketch image in the model making software, loads the sketch image into the window, and generates the corresponding target model in the window according to the model making instruction triggered by the technician. The model making software can be 3D Max, Maya, or the like.
[0088] In the embodiment of the present application, the original picture is an image of a target model, the original picture is composed of model views obtained by viewing the target model from different perspectives, and the original picture is formed by a plurality of pixels. For example, the model views can be a front view, a side view, a top view, and the like of the target model. The front view is obtained by viewing the target model from the front of the target model, the side view is obtained by viewing the target model from the side of the target model, and the top view is obtained by viewing the target model from the top of the target model.
[0089] In the embodiment of the present application, the model map refers to image materials rendered to the surface of the model, and the acquisition approach of the model map is not limited. The model map can be designed and generated by an image designer, or the existing map material can be acquired from other approaches (for example, an image website, a photographed photo, and the like). Before the model software is generated, the pixel size of the model map can be set, so that the map rendering is performed according to the pixel size.
[0090] In the optional embodiment of the present application, the scheme is a method for automatically generating a pixelated model. That is, the original picture image and the model map are composed of color blocks one by one, and different color blocks are arranged to form the model map and the original picture image. Since the model map is image materials rendered to the surface of the model, the target model after the model map is rendered is a pixelated model, and the surface of the target model can be composed of color blocks one by one.
[0091] In the embodiment of the present application, the positions of the model views in the original picture image are preset by a technician who makes the original picture image, so that when the original picture image is loaded into the model making software, the model making software can determine the model views according to the preset position relationship. Specifically, when the model views include a front view, a side view, and a top view, the original picture image can include at least three sub-images, and the three sub-images are located in the upper left corner region, the upper right corner region, the lower left corner region, and the lower right corner region of the original picture image. At this time, the method for determining the model views can also be:
[0092] acquiring a preset position relationship of the model views in the original picture image;
[0093] determining, based on the preset position relationship, that the sub-image located in the upper left corner region of the original picture image is the front view;
[0094] determining, based on the preset position relationship, that the sub-image located in the upper right corner region of the original picture image is the side view;
[0095] determining, based on the preset position relationship, that the sub-image located in the lower right corner region of the original picture image is the top view.
[0096] For example, as shown in FIG. 2, the original picture image 200 includes a front view sub-image 201, a side view sub-image 202, and a top view sub-image 203. The front view sub-image 201 is located in the upper left corner region of the original picture image 200, the side view sub-image 202 is located in the upper right corner region of the original picture image 200, and the top view sub-image 203 is located in the lower right corner region of the original picture image 200. Figure 3As shown in the original image schematic diagram, the original image can include four equal parts, wherein the part of the upper left corner region is determined as the front view 301, the part of the upper right corner region is determined as the side view 302, and the part of the lower right corner region is determined as the top view 303.
[0097] In addition, in order to generate the intersection model according to the model view, at least two model views can be included in the original image.
[0098] In step 202, a model plane corresponding to each model view is created in a three-dimensional space based on each model view.
[0099] In the embodiment of the present application, in order to make the generated model plane match the model view, and the model view is composed of a plurality of pixels, the model plane corresponding to each model view can be generated according to the pixels in the model view. In addition, since the pixels of the model view are composed of one by one color blocks, the generated model plane can also be a pixelized plane composed of one by one color blocks. The above step 202 “creating a model plane corresponding to each model view in a three-dimensional space based on each model view” can be:
[0100] Creating a candidate plane corresponding to each model view in a three-dimensional space based on the pixels in each model view, the candidate plane including a plurality of sub-planes, wherein one pixel corresponds to one sub-plane in the candidate plane;
[0101] Determining the transparent pixel in the model view corresponding to the to-be-processed sub-plane in the candidate plane;
[0102] Pruning the to-be-processed sub-plane in the candidate plane to form a model plane.
[0103] In the embodiment of the present application, in order to make the original image a rectangle, the blank place in the model view generated when watching the target model, which does not see the target model, is set as a transparent pixel, and in order to make the generated model not have useless transparent part, the sub-plane corresponding to the transparent pixel in the model plane generated based on the model view can be pruned.
[0104] In the embodiment of the present application, the data node type of the model plane generated according to the model view is a graphics type, and since the data node of the graphics type cannot be edited, the data node type of the model plane can be converted from the graphics type to the polygon type after the above step 202 “creating a model plane corresponding to each model view in a three-dimensional space based on each model view”.
[0105] For example, as shown in FIG. 3, the model view 301 is generated when watching the target model 100, and the model view 301 includes a transparent pixel 301a, which is the blank place in the model view 301 generated when watching the target model 100, which does not see the target model 100. Figure 4In the schematic diagram of the model plane shown, the model views are the front view, side view and bottom view. The xy plane in the three-dimensional space can be set as the preset bottom surface. The model plane 401 corresponding to the front view, the model plane 402 corresponding to the side view and the model plane 403 corresponding to the top view can be generated from the preset bottom surface 404 in the three-dimensional space.
[0106] In this embodiment of the application, since each model view needs to generate a corresponding model plane, in order to distinguish different model views and perform corresponding plane generation operations and plane position adjustment operations on different model views, model views corresponding to different directions can be identified. For example, the number side can be used to identify them, that is, the number 1 is used to identify the front view, the number 2 is used to identify the side view, and the number 3 is used to identify the top view.
[0107] Step 203: Adjust the relative position of each model plane based on the viewing angle of each model view, so that the relative position between each model plane matches the relative position of each model view on the target model.
[0108] In this embodiment of the application, since the initially generated model planes are all on a preset bottom surface in three-dimensional space, in order to make the silhouette models generated after the model planes are extruded intersect, the relative positions of each model plane can be adjusted based on the viewing angle of each model view, so that the relative positions between each model plane match the relative positions of each model view on the target model.
[0109] For example, such as Figure 5 The diagram shown illustrates the adjusted model plane. The model views include a front view, a side view, and a top view. Since the top view is generated from the top of the target model, the position of the model view 403 generated from the top view in 3D space can be set to remain unchanged, still located on the preset bottom surface 404. The positions of the model planes generated from the front and side views in 3D space are adjusted based on the viewing angles of the model planes generated from the top view and the front and side views. (The last sentence appears to be incomplete and possibly refers to a separate process.) Figure 4 The model plane 401 in the middle is adjusted to Figure 5 The location of model plane 501 in the model will... Figure 4 The model plane 402 in the middle is adjusted to Figure 5 The location of plane 502 in the model. Furthermore, the specific adjustment steps are not limited and can be flexibly set according to the actual situation; that is, the adjustment operation can be movement and rotation, etc.
[0110] Step 204: Based on the relative positions of each model plane and each model plane, generate intersecting silhouette models in three-dimensional space, and obtain the intersecting parts of each silhouette model to form an intersecting model.
[0111] In the embodiments of the present application, after the model planes are generated, extrusion operations can be performed on the model planes to generate corresponding three-dimensional models, i.e., silhouette models. Since the silhouette models are generated from the model planes by extending from one side of the model planes as the starting point, the silhouette models generated from the model planes can not intersect at the beginning. In order to obtain intersecting models, at least one of the silhouette models can be moved so that the silhouette models can intersect. In addition, since each model plane is a pixelated plane composed of color blocks, the surface of the intersecting models obtained from the silhouette models generated by performing the extrusion operation on the model planes can be composed of color blocks. Specifically, the step 204 of "generating intersecting silhouette models in the three-dimensional space according to the relative positions of the model planes and the model planes, and obtaining the intersecting part of each silhouette model to form an intersecting model" can be:
[0112] performing extrusion operations on the model planes at the relative positions of the model planes to generate corresponding silhouette models in the three-dimensional space;
[0113] moving at least one of the silhouette models so that the silhouette models intersect in the three-dimensional space;
[0114] obtaining the intersecting part of each silhouette model to form an intersecting model.
[0115] In the embodiments of the present application, the extrusion operation is an operation of extending a plane in a certain direction to form a three-dimensional model. The width of the extension of the extrusion operation can be determined according to the pixels of the model view. Specifically, the step of "performing extrusion operations on the model planes at the relative positions of the model planes to generate corresponding silhouette models in the three-dimensional space" can be:
[0116] determining the extension width of each model plane to extend to the corresponding silhouette model according to the number of pixels of each model view;
[0117] performing extrusion operations on the model planes based on the corresponding extension width of each model plane to generate corresponding silhouette models in the three-dimensional space.
[0118] For example, if each model view is a rectangle, the number of pixels of the adjacent two sides of the rectangle is n, and the pixel composition mode of the model view is n by n, the extension width of each model plane can be determined as n.
[0119] For another example, as shown in the front view model plane diagram in FIG. 6A, the front view model plane 601 is located in the three-dimensional space 60, as shown in the silhouette model diagram in FIG. 6B, the model plane 601 shown in FIG. 6A is changed to the silhouette model 701 by the extrusion operation. Figure 6 Figure 7 Figure 6
[0120] In this embodiment of the application, a preset origin can be set in a preset three-dimensional space, and the silhouette model can be moved based on the preset origin. The above step "moving at least one silhouette model so that the silhouette models intersect in the three-dimensional space" can be: moving at least one silhouette model so that the projection point of the center point of each silhouette model on the preset bottom surface coincides with the preset origin.
[0121] Furthermore, the setting of the preset origin is unrestricted; any point in 3D space can be set as the preset origin, or a preset origin can be set on the generated silhouette model. When the silhouette models are the silhouette models corresponding to the front view, the side view, and the top view, if a preset origin is set at any point in 3D space, each silhouette model can be moved to that preset origin, so that the center point of each silhouette model is located at that preset origin.
[0122] In the embodiments of this application, according to as follows Figure 5 In the schematic diagram of the model plane shown, based on the xy-plane in three-dimensional space, the model plane corresponding to the top view is located on the xy-plane. The center of the model plane corresponding to the top view can be set as the preset origin. Since the silhouette model corresponding to the top view extends towards the z-axis, the bottom center point of the silhouette model corresponding to the top view remains the preset origin. The silhouette model corresponding to the top view can be left unmoved. The silhouette model corresponding to the front view extends towards the negative y-axis, resulting in a silhouette model whose center is not at the preset origin. Moving the silhouette model corresponding to the front view towards the positive y-axis, and the silhouette model corresponding to the side view extending towards the positive x-axis, also results in a silhouette model whose center is not at the preset origin. Moving the silhouette model corresponding to the front view towards the negative x-axis, so that the projection point of the center point of the silhouette model formed by the front and side views onto the xy-plane is the preset origin, thus forming an intersecting model. For example... Figure 8 The diagram showing the intersection of silhouette models, and as shown... Figure 9 In the diagram of the intersecting model shown, the silhouette models corresponding to the front view, side view, and top view intersect to form model 801, thus obtaining the following... Figure 9 The intersection model 901 is shown.
[0123] In this embodiment of the application, after obtaining the intersecting model, since the obtained intersecting model may have multiple vertices with the same coordinates, the multiple vertices can be merged. Specifically, after step 204 above, "based on the relative positions of each model plane and each model plane, generate intersecting silhouette models in three-dimensional space, and obtain the intersecting parts of each silhouette model to form an intersecting model", the method further includes:
[0124] Identify vertices in the intersecting model that have at least two identical vertex coordinates and are to be merged.
[0125] merge the at least two to-be-merged vertices into one vertex of the intersection model.
[0126] In the embodiment of the present application, after the intersection model is obtained, since the obtained intersection model can have a hole, which can be formed due to the missing of a plane, the missing plane can be supplemented. Specifically, after the step 204 "generate the intersection silhouette model in the three-dimensional space according to the relative positions of the planes of the models and the planes of the models, and obtain the intersection part of each silhouette model to form the intersection model", the method further comprises:
[0127] determining the missing plane in the intersection model;
[0128] supplementing the missing plane in the intersection model.
[0129] In the embodiment of the present application, after the intersection model is obtained, since the obtained intersection model can have a redundant topological structure, i.e., a redundant line on the surface of the model or a redundant plane in the model, etc. Specifically, after the step 204 "generate the intersection silhouette model in the three-dimensional space according to the relative positions of the planes of the models and the planes of the models, and obtain the intersection part of each silhouette model to form the intersection model", the method further comprises:
[0130] determining the redundant topological structure in the intersection model;
[0131] eliminating the redundant topological structure.
[0132] For example, as shown in the intersection model schematic diagram shown in Figure 9 , a redundant line 902 appears, which is a redundant topological structure in the intersection model 901, and can be removed to form the topological structure cleaning schematic diagram shown in Figure 10 , and the partially cleaned intersection model 1001 shown in Figure 10 .
[0133] Step 205, cut the intersection model to determine the vertex texture coordinates of the cut intersection model.
[0134] In the embodiment of the present application, the step 205 "cut the intersection model to determine the vertex texture coordinates of the cut intersection model" can comprise:
[0135] determine the boundaries of each plane of the intersection model, cut the intersection model according to the boundaries to obtain a plurality of cut planes;
[0136] obtain the pixel reference size of the model map;
[0137] divide each cut plane into a plurality of polygon meshes of the pixel reference size;
[0138] Based on the vertex coordinates of the intersection model, the face normals formed by the vertices, and the meshes of each polygon, the vertex texture coordinates of the cut plane are determined.
[0139] Step 206: Render the corresponding model texture on the surface of the intersecting model based on the vertex texture coordinates to form the target model.
[0140] In this embodiment of the application, after determining the vertex texture coordinates, step 206 above, "rendering the corresponding model texture on the surface of the intersecting model based on the vertex texture coordinates to form the target model," can be:
[0141] Arrange the polygonal grids into adjacent, non-overlapping, grids to obtain the arranged grid.
[0142] Determine the rendering position of at least one model texture on the intersecting model based on vertex texture coordinates;
[0143] Based on the rendering position and the arrangement of the mesh, the corresponding model texture is rendered on the surface of the intersecting model to form the target model.
[0144] In this embodiment of the application, after determining the rendering position of at least one model texture on the intersecting model, since the polygon meshes are arranged adjacently, the rendering positions of other model textures on the intersecting model can be determined sequentially.
[0145] For example, such as Figure 11 The diagram shown is a schematic of the cut surface. Figure 9 The cut plane 1101 formed by the intersecting model 901 shown can be composed of multiple polygonal meshes 1102, with each polygonal mesh 1102 not overlapping and arranged adjacently.
[0146] In this embodiment of the application, since the surface of the target model is composed of polygonal meshes, and the computer program cannot recognize and process models composed of polygonal meshes, it is necessary to triangulate the target model. Specifically, after step 206 "rendering the corresponding model texture map on the surface of the intersecting model based on vertex texture coordinates to form the target model", the method further includes: setting the surface of the target model to be composed of triangular meshes.
[0147] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0148] The model automatic generation method provided by the embodiments of the present application can automatically generate a model, simplify the model production steps, reduce the time cost of model production, improve the cost performance of model production, and avoid model production errors to a great extent.
[0149] Please refer to Figure 12 , Figure 12 Another flowchart of the model automatic generation method provided by the embodiments of the present application is shown in FIG. 12. The specific flow of the method can be as follows:
[0150] Step 1201, obtain a sketch image used for generating a target model and a model texture of the target model.
[0151] For example, the sketch image includes three model views, i.e., a front view, a side view and a top view. The sketch image includes at least three sub-images, which are located in the upper left corner region, the upper right corner region, the lower left corner region and the lower right corner region of the sketch image respectively. Based on a preset position relationship, the sub-image located in the upper left corner region of the sketch image is determined as the front view, the sub-image located in the upper right corner region of the sketch image is determined as the side view, and the sub-image located in the lower right corner region of the sketch image is determined as the top view.
[0152] Step 1202, create a candidate plane corresponding to each model view in a three-dimensional space based on pixels in each model view.
[0153] The candidate plane includes a plurality of sub-planes, and one pixel corresponds to one sub-plane in the candidate plane.
[0154] Step 1203, remove the sub-planes corresponding to transparent pixels in the model view from the candidate plane to form a model plane.
[0155] Step 1204, convert the data node type of the model plane from a graph type to a polygon type.
[0156] Step 1205, perform an extrusion operation on each model plane at the relative position of each model plane to generate a silhouette model corresponding to each model plane in the three-dimensional space.
[0157] For example, the extension width of each model plane extending to the corresponding silhouette model is determined according to the number of pixels of each model view; and an extrusion operation is performed on each model plane based on the corresponding extension width of each model plane to generate the corresponding silhouette model of each model plane in the three-dimensional space.
[0158] Step 1206, moving at least one silhouette model so that each silhouette model intersects in the three-dimensional space.
[0159] For example, at least one silhouette model is moved so that the projection point of the center point of each silhouette model on the preset bottom surface coincides with the preset origin point.
[0160] Step 1207, obtaining the intersection part of each silhouette model to form an intersection model.
[0161] Step 1208, merging the points with the same coordinates of at least two vertices in the intersection model into one vertex, supplementing the missing planes, and eliminating the redundant topological structure.
[0162] Step 1209, cutting the intersection model to determine the vertex texture coordinates of the cut intersection model.
[0163] Specifically, the boundary of each plane of the intersection model is determined, the intersection model is cut according to the boundary to obtain a plurality of cut planes; the pixel reference size of the model map is obtained; each cut plane is divided into a plurality of polygonal meshes of pixel reference size; and the vertex texture coordinates of the cut plane are determined based on the vertex coordinates of the intersection model, the face normal formed by the vertex, and each polygonal mesh.
[0164] Step 1210, rendering the corresponding model map on the surface of the intersection model based on the vertex texture coordinates to form a target model.
[0165] Specifically, each polygonal mesh is arranged without overlapping and adjacent to obtain an arranged mesh; the rendering position of at least one model map on the intersection model is determined based on the vertex texture coordinates; and the corresponding model map is rendered on the surface of the intersection model based on the rendering position and the arranged mesh to form a target model.
[0166] Step 1211, setting the surface of the target model to be composed of triangular meshes.
[0167] All the above technical solutions can be combined to form optional embodiments of the present application, which will not be described one by one here.
[0168] The model automatic generation method provided in the embodiments of the present application can automatically generate a model, simplify the model production steps, reduce the time cost of model production, improve the cost performance of model production, and can greatly avoid model production errors.
[0169] To better implement the model automatic generation method of the embodiments of the present application, the embodiments of the present application further provide a model automatic generation device. Please refer to Figure 13 , Figure 13 The model automatic generation device provided in the embodiments of the present application has a structure diagram. The model automatic generation device can include an acquisition unit 1301, a creation unit 1302, an adjustment unit 1303, an intersection unit 1304, a cutting unit 1305, and a rendering unit 1306.
[0170] The acquisition unit 1301 is configured to acquire a sketch image used to generate a target model and a model map of the target model, and the sketch image includes at least two model views of the target model obtained from different viewing angles.
[0171] The creation unit 1302 is configured to create a model plane corresponding to each model view in a three-dimensional space based on each model view.
[0172] The adjustment unit 1303 is configured to adjust the relative positions of the model planes based on the viewing angles of each model view, so that the relative positions between the model planes match the relative positions of each model view on the target model.
[0173] The intersection unit 1304 is configured to generate a cutout model in a three-dimensional space according to the relative positions of the model planes and the model planes, and to acquire an intersection part of each cutout model to form an intersection model.
[0174] The cutting unit 1305 is configured to cut the intersection model and determine the vertex texture coordinates of the cut intersection model.
[0175] The rendering unit 1306 is configured to render a corresponding model map on the surface of the intersection model based on the vertex texture coordinates to form the target model.
[0176] Optionally, the model views include a front view, a side view and a top view, the sketch image includes at least three sub-images, the three sub-images are located in a top-left corner region, a top-right corner region, a bottom-left corner region and a bottom-right corner region of the sketch image respectively, and the method is further used for:
[0177] obtaining a preset positional relationship of the model views in the sketch image;
[0178] determining, based on the preset positional relationship, that the sub-image located in the top-left corner region of the sketch image is the front view;
[0179] determining, based on the preset positional relationship, that the sub-image located in the top-right corner region of the sketch image is the side view;
[0180] determining, based on the preset positional relationship, that the sub-image located in the bottom-right corner region of the sketch image is the top view.
[0181] Optionally, the creating unit 1302 is further used for:
[0182] creating candidate planes corresponding to the model views based on pixels in the model views in the three-dimensional space, the candidate planes including a plurality of sub-planes, wherein one pixel corresponds to one sub-plane in the candidate planes;
[0183] determining a to-be-processed sub-plane corresponding to a transparent pixel in the model view in the candidate planes;
[0184] removing the to-be-processed sub-plane in the candidate planes to form a model plane.
[0185] Optionally, the creating unit 1302 is further used for:
[0186] converting a data node type of the model plane from a graph type to a polygon type.
[0187] Optionally, the intersecting unit 1304 is further used for:
[0188] performing an extrusion operation on the model planes at relative positions of the model planes to generate silhouette models corresponding to the model planes in the three-dimensional space;
[0189] moving at least one silhouette model so that the silhouette models intersect in the three-dimensional space;
[0190] obtaining an intersection part of the silhouette models to form an intersection model.
[0191] Optionally, the intersecting unit 1304 is further used for:
[0192] determining an extension width of the model planes extended to the corresponding silhouette models according to a number of pixels of the model views;
[0193] The extrusion operation is performed on each model plane based on the corresponding extended width, and a silhouette model corresponding to each model plane is generated in the three-dimensional space.
[0194] Optionally, the three-dimensional space includes a preset bottom surface and a preset origin point on the preset bottom surface, and the intersecting unit 1304 is further configured to:
[0195] The at least one silhouette model is moved so that a projection point of a center point of each silhouette model on the preset bottom surface coincides with the preset origin point.
[0196] Optionally, the intersecting unit 1304 is further configured to:
[0197] Determine at least two to-be-merged vertices in the intersecting model that have the same coordinates;
[0198] Merge the at least two to-be-merged vertices into one vertex of the intersecting model.
[0199] Optionally, the intersecting unit 1304 is further configured to:
[0200] Determine a missing plane in the intersecting model;
[0201] Supplement the missing plane in the intersecting model.
[0202] Optionally, the intersecting unit 1304 is further configured to:
[0203] Determine a redundant topological structure in the intersecting model;
[0204] Eliminate the redundant topological structure.
[0205] Optionally, the cutting unit 1305 is further configured to:
[0206] Determine the boundaries of each plane of the intersecting model, cut the intersecting model according to the boundaries, and obtain a plurality of cut planes;
[0207] Obtain a pixel reference size of a model map;
[0208] Divide each cut plane into a plurality of polygonal meshes of the pixel reference size;
[0209] Determine vertex texture coordinates of the cut plane based on vertex coordinates of the intersecting model, face normals formed by the vertices, and the plurality of polygonal meshes.
[0210] Optionally, the rendering unit 1306 is further configured to:
[0211] Arrange the plurality of polygonal meshes without overlapping and adjacent to each other to obtain arranged meshes;
[0212] Determine a rendering position of at least one model map on the intersecting model based on the vertex texture coordinates;
[0213] Render the corresponding model map on the surface of the intersection model based on the rendering position and the arranged grid, to form the target model.
[0214] Optionally, the rendering unit 1306 is further configured to:
[0215] The surface of the target model is composed of a triangular grid.
[0216] All the technical solutions described above can be combined in any manner to form optional embodiments of the present application, which will not be described one by one here.
[0217] The model automatic generation device provided by the embodiments of the present application can automatically generate a model according to the model view in the original drawing image, further generate an intersection model, and automatically obtain the vertex texture coordinates of the intersection model after the model making software on the terminal obtains the original drawing image and the model map of the target model and receives a model generation instruction, and finally render the model map on the surface of the intersection model based on the vertex texture coordinates to generate the target model, so that the software can automatically generate a model, the model making steps are simplified, the time cost of model making is reduced, the cost performance of model making is improved, and the software making is performed according to the set standardized instruction, which can greatly avoid errors in model making.
[0218] Correspondingly, the embodiments of the present application also provide a computer device, which can be a terminal, such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer, a personal digital assistant, and the like. Figure 14 As shown in Figure 14 The computer device provided by the embodiments of the present application is a structural schematic diagram. The computer device 1400 includes a processor 1401 having one or more processing cores, a memory 1402 having one or more computer readable storage media, and a computer program stored in the memory 1402 and executable on the processor. The processor 1401 is electrically connected to the memory 1402. Those skilled in the art can understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0219] The processor 1401 is the control center of the computer device 1400, which connects all parts of the computer device 1400 through various interfaces and lines, processes data and performs various functions of the computer device 1400 by running or loading the software program and / or module stored in the memory 1402 and calling the data stored in the memory 1402, thereby overall monitoring the computer device 1400.
[0220] In the embodiments of the present application, the processor 1401 in the computer device 1400 loads the instructions corresponding to the processes of one or more application programs into the memory 1402 and runs the application programs stored in the memory 1402 by the processor 1401 to implement various functions according to the following steps:
[0221] obtain a sketch image used for generating a target model and a model map of the target model, the sketch image including at least two model views of the target model taken from different perspectives;
[0222] create a model plane corresponding to each model view in a three-dimensional space based on each model view;
[0223] adjust the relative positions of the model planes based on the viewing perspectives of the model views, so that the relative positions between the model planes match the relative positions of the model views on the target model;
[0224] generate intersecting silhouette models in the three-dimensional space according to the relative positions of the model planes and the model planes, and obtain intersecting parts of the silhouette models to form an intersecting model;
[0225] cut the intersecting model and determine vertex texture coordinates of the cut intersecting model;
[0226] render the corresponding model map on the surface of the intersecting model based on the vertex texture coordinates to form the target model.
[0227] The specific implementation of each operation can be referred to the foregoing embodiments, which will not be described here.
[0228] Optionally, as shown in Figure 14 the computer device 1400 further includes a touch display screen 1403, a radio frequency circuit 1404, an audio circuit 1405, an input unit 1406, and a power supply 1407. The processor 1401 is electrically connected with the touch display screen 1403, the radio frequency circuit 1404, the audio circuit 1405, the input unit 1406, and the power supply 1407, respectively. Those skilled in the art can understand that the computer device structure shown in the Figure 14 does not constitute a limitation on the computer device, and can include more or fewer components than the diagram, or combine certain components, or different arrangement of components.
[0229] The touch display screen 1403 can be used to display a graphical user interface and receive operation instructions generated by user acting on the graphical user interface. The touch display screen 1403 can include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, which can be composed of graphics, text, icons, video and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations (such as user's finger, stylus or any suitable object or accessory on or near the touch panel) on or near it and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts of a touch detection device and a touch controller. The touch detection device detects the touch position of the user and detects the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch coordinates, and then sends it to the processor 1401, and can also receive and execute the commands sent by the processor 1401. The touch panel can cover the display panel, and when the touch panel detects the touch operation on or near it, it transmits to the processor 1401 to determine the type of touch event, and then the processor 1401 provides corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 1403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can realize the input and output functions as two independent components. That is, the touch display screen 1403 can also realize the input function as part of the input unit 1406.
[0230] The radio frequency circuit 1404 can be used to transceive radio frequency signals to establish wireless communication with network devices or other computer devices, and transceive signals between network devices or other computer devices.
[0231] The audio circuit 1405 can be used to provide an audio interface between a user and the computer device through a speaker and a microphone. The audio circuit 1405 can convert received audio data into an electrical signal and transmit the electrical signal to the speaker for conversion into a sound signal output by the speaker. On the other hand, the microphone collects a sound signal and converts the sound signal into an electrical signal, which is received by the audio circuit 1405 and converted into audio data. The audio data is output to the processor 1401 for processing, and then transmitted to another computer device through the radio frequency circuit 1404, for example, or output to the memory 1402 for further processing. The audio circuit 1405 can also include a jack for a headset to provide communication between the headset and the computer device.
[0232] The input unit 1406 can be used to receive inputted numbers, character information or user feature information (such as fingerprints, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0233] The power supply 1407 is used to supply power to various components of the computer device 1400. Optionally, the power supply 1407 can be logically connected to the processor 1401 through a power management system, so that the power management system can be used to manage charging, discharging and power consumption management, etc. The power supply 1407 can also include one or more direct current or alternating current power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, etc.
[0234] Although Figure 14 The computer device 1400 can also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which are not shown in the figure.
[0235] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0236] As can be seen from the above, the computer device provided in the embodiment can automatically generate a model according to a model generation instruction after the model making software on the terminal acquires a draft image used to generate a target model and a model map of the target model, further generate an intersection model, and automatically acquire vertex texture coordinates of the intersection model, and finally render the model map on the surface of the intersection model based on the vertex texture coordinates to generate the target model, so that the software can automatically generate a model, simplify the model making steps, reduce the time cost of model making, and improve the performance-price ratio of model making. Moreover, the software making is performed according to the set standardized instruction, so that errors in model making can be greatly avoided.
[0237] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by relevant hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0238] To this end, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of computer programs capable of being loaded by a processor to execute the steps in any of the model automatic generation methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0239] obtain a sketch image used for generating a target model and a model map of the target model, the sketch image including at least two model views of the target model taken from different perspectives;
[0240] create a model plane corresponding to each model view in a three-dimensional space based on each model view;
[0241] adjust the relative positions of the model planes based on the viewing perspectives of the model views, so that the relative positions between the model planes match the relative positions of the model views on the target model;
[0242] generate intersecting silhouette models in the three-dimensional space according to the relative positions of the model planes and the model planes, and obtain an intersection model formed by the intersecting parts of the silhouette models;
[0243] cut the intersection model and determine the vertex texture coordinates of the cut intersection model;
[0244] render the corresponding model map on the surface of the intersection model based on the vertex texture coordinates, and form the target model.
[0245] The specific implementation of each of the above operations can be referred to the previous embodiments, which will not be described here.
[0246] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0247] Since the computer program stored in the storage medium can execute the steps in any of the model automatic generation methods provided by the embodiments of the present application, the beneficial effects that can be achieved by any of the model automatic generation methods provided by the embodiments of the present application can be achieved. For details, please refer to the previous embodiments, which will not be described here.
[0248] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0249] The model automatic generation method and device provided by the embodiments of the present application, computer device and storage medium are described in detail above, the principle and implementation manner of the present application are described in this paper, and the above embodiment is only used to help understand the technical solution and core idea of the present application; those skilled in the art should understand that the technical solution recorded in the foregoing embodiments can be modified or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for automatically generating models, characterized in that, include: Obtain original images for generating a target model and model textures of the target model. The original images include at least two model views obtained from viewing the target model from different perspectives. The model textures refer to image materials rendered onto the surface of the model. Based on each of the model views, create a model plane corresponding to each of the model views in three-dimensional space; The relative positions of the model planes are adjusted based on the viewing angle of each model view, so that the relative positions between the model planes match the relative positions of the model views on the target model. Based on the relative positions of the model planes and the model planes themselves, intersecting silhouette models are generated in the three-dimensional space, and the intersecting parts of the silhouette models are obtained to form an intersecting model. Cut the intersecting model and determine the vertex texture coordinates of the cut intersecting model; Based on the vertex texture coordinates, a corresponding model texture is rendered on the surface of the intersecting model to form the target model; wherein... After creating the model plane corresponding to each of the model views in three-dimensional space based on each of the model views, the method further includes: Convert the data node type of the model plane from a graphic type to a polygon type; After generating intersecting silhouette models in the three-dimensional space based on the relative positions of the model planes and the model planes themselves, and obtaining the intersecting portions of the silhouette models to form an intersecting model, the method further includes: Identify vertices in the intersection model that have at least two identical vertex coordinates to be merged; At least two vertices to be merged are merged into one vertex of the intersecting model.
2. The method according to claim 1, characterized in that, The model view includes a front view, a side view, and a top view. The original image includes at least three sub-images, which are located in the upper left, upper right, lower left, and lower right corners of the original image, respectively. The method further includes: Obtain the preset positional relationship of each of the model views in the original image; Based on the preset positional relationship, the sub-image located in the upper left corner region of the original image is determined as the front view; Based on the preset positional relationship, the sub-image located in the upper right corner region of the original image is determined as the side view; Based on the preset positional relationship, the sub-image located in the lower right corner region of the original image is determined as the top view.
3. The method according to claim 1, characterized in that, The step of creating a model plane corresponding to each of the model views in three-dimensional space based on each of the model views includes: Based on the pixels in each of the model views, candidate planes corresponding to each of the model views are created in the three-dimensional space. The candidate planes include multiple sub-planes, wherein one pixel corresponds to one of the sub-planes in the candidate planes. Determine the sub-plane to be processed corresponding to the transparent pixels in the model view in the candidate plane; The sub-plane to be processed is removed from the candidate plane to form the model plane.
4. The method according to claim 1, characterized in that, The step of generating intersecting silhouette models in the three-dimensional space based on the relative positions of the model planes and the model planes themselves, and obtaining the intersecting portions of the silhouette models to form an intersecting model, includes: An extrusion operation is performed on each of the model planes at their relative positions to generate a silhouette model corresponding to each of the model planes in the three-dimensional space; Move at least one of the silhouette models such that the silhouette models intersect in the three-dimensional space; The intersecting portions of each silhouette model are obtained to form the intersecting model.
5. The method according to claim 4, characterized in that, The step of performing an extrusion operation on each of the model planes at their relative positions to generate a silhouette model corresponding to each of the model planes in the three-dimensional space includes: Based on the number of pixels in each of the model views, determine the extension width of each model plane as the corresponding silhouette model; Based on the extension width corresponding to each model plane, an extrusion operation is performed on each model plane to generate a silhouette model corresponding to each model plane in the three-dimensional space.
6. The method according to claim 4, characterized in that, The three-dimensional space includes a preset bottom surface and a preset origin located on the preset bottom surface. Moving at least one of the silhouette models such that the silhouette models intersect in the three-dimensional space includes: Move at least one of the silhouette models so that the projection point of the center point of each silhouette model on the preset bottom surface coincides with the preset origin.
7. The method according to claim 1, characterized in that, After generating intersecting silhouette models in the three-dimensional space based on the relative positions of the model planes and the model planes themselves, and obtaining the intersecting portions of the silhouette models to form an intersecting model, the method further includes: Identify the missing planes in the intersection model; The missing plane is supplemented in the intersection model.
8. The method according to claim 1, characterized in that, After generating intersecting silhouette models in the three-dimensional space based on the relative positions of the model planes and the model planes themselves, and obtaining the intersecting portions of the silhouette models to form an intersecting model, the method further includes: Identify redundant topologies in the intersection model; Eliminate the redundant topology.
9. The method according to claim 1, characterized in that, The step of cutting the intersecting model and determining the vertex texture coordinates of the cut intersecting model includes: Determine the boundaries of each plane of the intersecting model, and cut the intersecting model according to the boundaries to obtain multiple cut planes; Obtain the pixel reference size of the model texture; Each of the cut planes is divided into multiple polygonal grids of the pixel reference size; Based on the vertex coordinates of the intersecting model, the face normals formed by the vertices, and each of the polygon meshes, the vertex texture coordinates of the cut plane are determined.
10. The method according to claim 9, characterized in that, The step of rendering the corresponding model texture map on the surface of the intersecting model based on the vertex texture coordinates to form the target model includes: Arrange the polygonal grids into non-overlapping and adjacent grids to obtain the arranged grid; Based on the vertex texture coordinates, determine the rendering position of at least one of the model textures on the intersecting models; Based on the rendering position and the arranged mesh, the corresponding model texture is rendered on the surface of the intersecting model to form the target model.
11. The method according to claim 1, characterized in that, After rendering the corresponding model texture map on the surface of the intersecting model based on the vertex texture coordinates to form the target model, the method further includes: The surface of the target model is composed of a triangular mesh.
12. An automatic model generation device, characterized in that, include: The acquisition unit is used to acquire the original image for generating the target model and the model texture of the target model. The original image includes at least two model views obtained from viewing the target model from different perspectives. The model texture refers to image material rendered onto the surface of the model. A creation unit is used to create a model plane corresponding to each of the model views in three-dimensional space based on each of the model views; The adjustment unit is used to adjust the relative position of each model plane based on the viewing angle of each model view, so that the relative position between each model plane matches the relative position of each model view on the target model; An intersection unit is used to generate intersecting silhouette models in the three-dimensional space based on the relative positions of each model plane and each model plane, and to obtain the intersecting parts of each silhouette model to form an intersection model; A cutting unit is used to cut the intersecting model and determine the vertex texture coordinates of the cut intersecting model; A rendering unit is used to render a corresponding model texture map on the surface of the intersecting model based on the vertex texture coordinates, thereby forming the target model; The creation unit is also used to convert the data node type of the model plane from a graphic type to a polygon type; The intersection unit is further configured to identify at least two vertices in the intersection model that have the same coordinates and merge them into one vertex of the intersection model.
13. A computer device, characterized in that, include: Memory, used to store computer programs; A processor for implementing the steps of the automatic model generation method as described in any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the model automatic generation method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
VR video display method and device, and terminal
CN108174174A