Model UV island acquisition method and device, computer equipment and storage medium
By acquiring and processing the vertex and texture coordinate information of the three-dimensional model, performing two-dimensional expansion and mesh surface screening, the problem of inaccurate acquisition of UV islands in the existing technology is solved, and the accurate evaluation of the UV expansion effect of the three-dimensional model is achieved.
Patent Information
- Application Number
- CN202311008783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to accurately obtain the UV island of three-dimensional models, which leads to difficulty in quality inspection of UV deployment effects.
By obtaining the vertex coordinate information and texture coordinate information of the model vertex of the target object model that has been mapped, performing two-dimensional expansion, dividing the set of mesh surfaces, and filtering the unfolded mesh surfaces to obtain a UV island.
The accuracy of acquisition of UV islands is improved, so that the UV expansion results of the target object model can be accurately displayed, and the reviewer's evaluation of the UV expansion effect is simplified.
Smart Images

Figure CN119478178A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, device, computer equipment and storage medium for obtaining a model UV island, wherein the storage medium is a computer-readable storage medium. Background Art
[0002] To conduct quality inspection on the UV unfolding effect of 3D models, the production staff usually exports the 3D models made by digital content creation tools (DCC) into universal formats such as gltf and obj, and then sends them to the reviewers for quality inspection. The reviewers import them into the corresponding DDC software on their devices. Since UV Islands require the original information related to the UV islands of the DCC software to be restored, and the original information cannot be obtained after exporting to the universal format, the UV islands will be displayed incorrectly when imported into DCC again, and the reviewers cannot judge the UV unfolding effect of the 3D model. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, computer device and computer-readable storage medium for obtaining a model UV island, which can improve the accuracy of obtaining the UV island, so that the UV unfolding result of the target object model can be accurately displayed, so that the reviewer can evaluate the UV unfolding effect of the target object model.
[0004] The present application provides a method for obtaining a model UV island, including:
[0005] Obtaining vertex coordinate information and corresponding texture coordinate information of model vertices of the mapped target object model;
[0006] Performing two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes an unfolded mesh surface of the target object model;
[0007] Dividing the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set;
[0008] The unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set are screened to obtain UV islands, wherein the unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
[0009] Accordingly, an embodiment of the present application also provides a device for acquiring a model UV island, comprising:
[0010] An acquisition unit, used for acquiring vertex coordinate information and corresponding texture coordinate information of model vertices of the mapped target object model;
[0011] an unfolding unit, configured to unfold the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes the unfolded mesh surface of the target object model;
[0012] A division unit, configured to divide the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set;
[0013] The screening unit is used to screen the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands, wherein the unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
[0014] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any one of the model UV island acquisition methods provided in the embodiments of the present application.
[0015] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any one of the model UV island acquisition methods provided in the embodiments of the present application.
[0016] The embodiment of the present application obtains vertex coordinate information and corresponding texture coordinate information of the model vertices of the mapped target object model; unfolds the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolded plane, which includes the unfolded mesh surface of the target object model; divides the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; and screens the unfolded mesh surfaces corresponding to the mesh surfaces in the mesh surface set to obtain UV islands, wherein the unfolded mesh surfaces corresponding to the UV islands have the same normals and are texture-related.
[0017] The mesh faces of the UV island are interconnected in the three-dimensional model, and the corresponding meshes after unfolding are also interconnected. Therefore, the embodiment of the present application can obtain a set of mesh faces that are interconnected through model vertices on the target object model based on the vertex coordinate information of the model vertices of the target object model, and then filter out the mesh faces with adjacent textures and the same normals, so as to accurately obtain the UV island of the target object model. The present application obtains the UV island based on the vertex coordinate information and texture coordinate information of the target object model, and there is no situation where the information cannot be obtained. The accuracy of obtaining the UV island can be improved, so that the UV unfolding result of the target object model can be accurately displayed, thereby improving the effect of the reviewer's evaluation of the UV unfolding effect of the target object model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a flow chart of a method for obtaining a model UV island provided in an embodiment of the present application;
[0020] Figure 2 It is a UV diagram of the model provided in the embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of UV island acquisition results of the DDC software provided in an embodiment of the present application;
[0022] Figure 4 is a schematic diagram showing a texture mapping provided in an embodiment of the present application;
[0023] Figure 5 It is a schematic diagram of the grid mapping and mapping processing results provided in the embodiment of the present application;
[0024] Figure 6 This is another schematic diagram of a grid map and mapping processing result provided in an embodiment of the present application.
[0025] Figure 7 is a flowchart of obtaining face structure data provided by an embodiment of the present application;
[0026] Figure 8 is a flow chart of reconstructing a UV island provided in an embodiment of the present application;
[0027] Fig. 9 is a schematic diagram of marking connecting edge lines provided in an embodiment of the present application;
[0028] Fig.10is a schematic diagram of a dynamic map provided in an embodiment of the present application;
[0029] Fig.11 It is a schematic diagram of a device for acquiring a model UV island provided in an embodiment of the present application;
[0030] Fig.12 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only 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 those skilled in the art without creative work are within the scope of protection of this application.
[0032] The embodiment of the present application provides a method, device, computer equipment and computer readable storage medium for obtaining a model UV island. The device for obtaining a model UV island can be integrated in a computer equipment, which can be a server or a terminal.
[0033] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0034] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0035] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0036] This embodiment will be described from the perspective of a device for acquiring a model UV island. The device for acquiring a model UV island may be integrated into a computer device, which may be a server or a terminal.
[0037] The present application embodiment provides a method for obtaining a model UV island, such as Figure 1 As shown, the specific process of the method for obtaining the UV island of the model can be as follows:
[0038] 101. Obtain vertex coordinate information and corresponding texture coordinate information of model vertices of a mapped target object model.
[0039] For example, the model data of the target object model contains coordinate information of model vertices in three-dimensional space and coordinate information in a texture map. By traversing the model data of the target object model, vertex coordinate information and texture coordinate information of the model vertices of the target object model can be obtained.
[0040] The target object model may be a three-dimensional model corresponding to the target object, and the target object may be an entity existing in the real world or an object in the virtual world, such as a game character, a house, a stone gate, or a plant.
[0041] The target object model can be obtained by 3D modeling using digital content creation tools (DCC) such as 3DsMax, Maya or Blender. 3D modeling is a very important link in fields such as game design and architectural design. Real-time rendering or offline rendering based on 3D model data can achieve simulation effects.
[0042] In computer graphics, the vertices of a model are the basic units that make up the model. A model can be composed of a series of vertices. The vertex coordinate information of the model vertices is used to determine the position of the model vertices in three-dimensional space. The model vertices can form polygonal patches such as triangles and quadrilaterals, that is, mesh surfaces. The lines connecting these vertices and the mesh surfaces define the geometric shape of the model. The texture coordinate information of the model vertices is used to determine the position of the model vertices in the texture map.
[0043] Mapping processing can refer to the process of mapping a texture map to a target object model so that the target object model has the texture in the texture map. It can also be called texture mapping processing. Mapping a two-dimensional texture map to the surface of a three-dimensional model according to certain rules can present realistic texture effects in three-dimensional space. It is a key step in the 3D modeling process.
[0044] The mapping process includes UV mapping, which can be called UV expansion or UV unfolding. UV expansion refers to the process of reasonably tiling the three-dimensional surface on the two-dimensional canvas in order to reasonably distribute the UV texture of the three-dimensional model on the canvas. Specifically, it can be mapping the model vertices to the two-dimensional canvas. Each model is composed of individual mesh surfaces, which can be considered as the "skin" of the three-dimensional model. By distributing these three-dimensional "skins" on the two-dimensional canvas, the texture coordinate information corresponding to each model vertex can be obtained, and then the details of the texture map can be projected from the canvas to the three-dimensional model according to the texture coordinate information.
[0045] Texture coordinate information includes UV coordinates. UV is a two-dimensional coordinate system defined based on texture mapping, which is used to describe texture mapping on the surface of a three-dimensional model. UV coordinates are usually represented by two values, namely, U coordinates and V coordinates. The U coordinate is similar to the X coordinate, indicating the horizontal coordinate of the texture, and the V coordinate is similar to the Y coordinate, indicating the vertical coordinate of the texture. By combining the U coordinate and the V coordinate, the texture coordinate information corresponding to the model vertex on the model surface can be determined, so that the color that the model vertex should display can be determined according to the texture mapping.
[0046] The effect of UV development is related to the mapping effect of the 3D model. High-quality UV development can save bandwidth and improve running performance. Especially for the game field, there are a large number of 3D models in the game. The effect of UV development can significantly improve the performance of the game. The following standards are generally used to evaluate the effect of UV development:
[0047] 1. Pattern distortion: When mapping a texture map to a 3D model surface, the shape and proportion of the pattern may be distorted due to the complexity of the surface shape. One criterion for evaluating the effect of UV unfolding is the degree of pattern distortion, that is, whether the shape and proportion of the pattern in the UV mapping are consistent with the actual texture map.
[0048] 2. Continuity of texture pattern: On the surface of a 3D model, UV mapping needs to ensure the continuity of the texture pattern, that is, the texture patterns on adjacent surfaces should be able to connect seamlessly. One criterion for evaluating the effect of UV unfolding is the continuity of the texture pattern, that is, whether the continuity between adjacent surfaces is good.
[0049] 3. Flatness of UV layout: When UV mapping a 3D model, the model surface needs to be cut and unfolded to generate a 2D UV layout. One criterion for evaluating UV effects is the flatness of the UV layout, that is, whether the UV layout is flat, without intersections and overlaps.
[0050] 4. Consistency of UV scaling and rotation: On the surface of a 3D model, different parts may need to use different texture maps. One criterion for evaluating the effect of UV unfolding is the consistency of UV scaling and rotation, that is, whether the UV scaling and rotation between different parts are consistent and whether they can be seamlessly connected.
[0051] 5. Space utilization: whether repeated components share UVs, and whether symmetrical UVs are used as much as possible.
[0052] Auditors usually evaluate the UV unfolding effect of 3D models based on the UV review tool of the local client. It is necessary to install the UV review tool on the local terminal device to realize real-time editing, modification and debugging of the 3D model UV data, and to preview and test the scene in real time.
[0053] Due to compatibility issues between different operating systems, different versions of UV review tools need to be developed for different platforms, which increases the workload of developers. The UV review tool is installed on the local terminal device of the auditor, making it difficult to maintain the UV review tool.
[0054] Moreover, different 3D models may be created through different DDC software. Therefore, various DDC software need to be installed in the terminal device so that the 3D models produced by different software can be reviewed. Auditors also need to master the use of different DDC software, which requires high professional ability of auditors.
[0055] In addition, since UV Islands require the original information of the DCC software to be restored, when exported to common formats such as gltf and obj, the original information can no longer be obtained, resulting in display errors of UV islands when imported into DCC again.
[0056] For example, Figure 2 The UV unfolding of the 3D model shown in the left image area during the texture mapping process is as follows Figure 2 As shown in the image area on the right, the thick white line is the edge of a UV island, and the surface surrounded by the thinner lines is the mesh surface after unfolding. After the 3D model made by 3ds Max is exported to a common format such as gltf, obj, etc., it is imported into 3ds Max again and UV unfolded. The UV unfolding result is as follows Figure 3 As shown in the figure, the entire periphery of the cylinder is unfolded into a UV island, that is, the UV islands are merged and the edge information is lost; after the 3D model made in Maya is exported to general formats such as gltf and obj, it is imported into 3ds Max again and UV unfolded. In the UV unfolding result, the unfolding of UV island is wrong, and the faces belonging to one UV island are divided into different UV islands; after the 3D model made in Blender is exported to general formats such as gltf and obj, it is imported into Blender again and UV unfolded. In the UV unfolding result, the unfolding of UV island is wrong, and the faces belonging to one UV island are divided into different UV islands.
[0057] The model UV island acquisition method provided in the embodiment of the present application can be run on a Web client without installing review tools on the terminal device, thereby solving the compatibility issues of quality inspection of different devices and being easy to maintain.
[0058] Moreover, the Web client can render 3D models based on WebGL. The Web client cooperates with the server to convert DCC files and convert various DCC files into formats such as gltf that can run on WebGL. On this basis, the model data of the target object model is parsed and an online quality inspection service for UV data is built. Model makers do not need to pass DCC files to reviewers. Reviewers can obtain the UV island display results of the target object model through the Web client. There is no need to import the exported DCC files into the DDC software for quality inspection again, which can reduce the time required for the quality inspection process of the 3D model and reduce the audit cost.
[0059] WebGL (Web Graphics Library) is a 3D drawing protocol. This drawing technology standard allows JavaScript and OpenGL ES2.0 to be combined together. By adding a JavaScript binding to OpenGL ES2.0, WebGL can provide hardware 3D accelerated rendering for HTML5 Canvas, so that Web developers can use the system graphics card to display 3D scenes and models more smoothly in the browser, and can also create complex navigation and data visualization. The WebGL technology standard eliminates the trouble of developing special rendering plug-ins for web pages, and can be used to create website pages with complex 3D structures, and can even be used to design 3D web games, etc.
[0060] 102. Perform two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes the unfolded mesh surface of the target object model.
[0061] Among them, the mesh surface is a plane on the target object model, and the unfolded mesh surface is a plane after the mesh surface on the target object model is unfolded in two dimensions. The mesh surface can be considered as a plane in three-dimensional space, and the unfolded mesh surface is a plane obtained by mapping the mesh surface in three-dimensional space to two-dimensional space.
[0062] Since the texture coordinate information represents the position of the model vertices in the texture map, the mesh surface of the target object model can be unfolded on a two-dimensional plane according to the texture coordinate information to obtain the two-dimensional unfolding plane of the mesh surface of the target object model. The two-dimensional unfolding plane includes the unfolded mesh surface corresponding to each mesh surface in the target object model. According to the two-dimensional unfolding plane, it can be judged whether the UV unfolding of the target object model is overlapping, crossing, and flat, so as to determine the flatness of the UV unfolding, and then the UV unfolding effect of the target object model can be evaluated.
[0063] During the texture mapping process, different organizations and groups have different specifications for the UV coordinates of the texture. For example, some groups stipulate that the values of the U coordinates and V coordinates of each texture are between [0,1], that is, the target object model can only be unfolded within this area, so it is necessary to judge whether the position of the unfolded mesh surface of the target object model is located in the specified texture map area. The target object model can be unfolded on the texture map for judgment. In one embodiment, "two-dimensionally unfolding the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane" includes:
[0064] Obtain the texture map corresponding to the target object model, and mark the preset map area in the texture map;
[0065] The target object model is unfolded on the texture map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the texture map, so as to determine whether the two-dimensional unfolding plane is located in a preset mapping area.
[0066] For example, obtain the texture map corresponding to the target object model, the texture map is the map used for texture mapping of the target object model, mark the preset mapping area of the texture map, the preset mapping area can be determined based on a preset UV range, and then mark the preset mapping area so that the reviewer can intuitively determine whether the UV expansion of the target object model is in the correct area.
[0067] Then, UV wireframe expansion is performed according to the texture coordinate information of the target object model to expand the wireframe of the target object model into the texture map.
[0068] Assume that the preset mapping area is the area corresponding to 0≤U≤1, 0≤V≤1, such as Figure 4 As shown, the preset mapping area can be marked with a wireframe. If part of the mesh surface after unfolding in the two-dimensional unfolding plane of the target object model is outside the area marked by the wireframe, the reviewer can determine the part with UV unfolding error, and determine the UV unfolding effect of the target object model according to the distribution of the mesh surface after unfolding in the preset mapping area and the non-preset mapping area.
[0069] Optionally, the density and unfolding direction of the texture map may also be checked. The UV unfolding direction of the target object model may be determined by binding a two-dimensional unfolding plane and a map with a direction and a chessboard layout marked thereon to the target object model. That is, in one embodiment, the step of "two-dimensionally unfolding the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane" may specifically include:
[0070] Obtain a preset checkered map, wherein the checkered map includes a plurality of checkered image areas distributed in a chessboard shape, adjacent checkered image areas have different colors, and each checkered image area has a direction mark;
[0071] Unfolding the target object model on the grid map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the grid map;
[0072] According to the correspondence between the two-dimensional unfolded plane and the grid map, the grid map is drawn on the target object model. According to the target object model after drawing the grid map, the distribution and drawing direction of the grid image area in the grid map on the target object model can be determined.
[0073] For example, a preset grid map may be obtained, wherein the grid map includes a plurality of grid image areas, the shape of the grid image areas may be a rectangle or a square, and the colors of adjacent grid image areas are different. The grid map is divided into a plurality of grid areas based on color in a checkerboard shape, and each grid image area has a direction mark.
[0074] The UV wireframe of the target object model can be unfolded according to the texture coordinate information, so as to unfold the wireframe of the target object model in a grid map, and map the texture in the grid map to the target object model, so as to replace the texture of the target object model with the texture in the grid map.
[0075] In one embodiment, each square area has a different color, so that the position where each square image area is drawn into the target object model can be quickly determined based on the color.
[0076] In another embodiment, the grid map can be as follows Figure 5 and Figure 6 As shown in the black and white checkerboard, since the checkered image area has only two colors, different checkered image areas cannot be identified by color. Different checkered image areas can be marked by other identifiers, such as Figure 5 and Figure 6 As shown in the figure, the coordinates are marked. The UV wireframe expansion result of the target object model in the grid map and the target object model with the grid map drawn are as follows Figure 5 and Figure 6 shown.
[0077] By drawing a grid map, the UV unfolding direction can be determined according to the direction mark of the grid image area on the target object model, and whether the distribution density of the texture map on the target object model is uniform can be determined, thereby performing quality inspection on the UV unfolding direction and map density of the target object model.
[0078] In addition, since the checkered image area in the checkered map is a regular shape, the degree of pattern distortion can be determined by observing whether the checkered image area on the target object model is deformed; and the checkered image area is seamlessly connected in the checkered map and has different colors. By observing the distribution of adjacent checkered image areas on the target object model, the continuity of the texture pattern can be determined to evaluate the UV unfolding effect of the target object model.
[0079] Therefore, the two-dimensional unfolding effect of the target object model can be determined according to the direction marks on the target object model after the grid map is drawn and the distribution of the grid image area.
[0080] 103. Divide the mesh surfaces on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set.
[0081] Among them, the mesh surface can be a plane represented by a mesh, which contains information such as the traversal order of model vertices, vertex coordinate information, texture coordinate information, normal and color. The mesh surface can be a plane determined based on the traversal order and vertex coordinate information of the model vertices. In the computer program that implements the method for obtaining the model UV island provided in the embodiment of the present application, the mesh surface can be represented by the vertex coordinate information and texture coordinate information of the model vertices.
[0082] In one embodiment, the mesh surface set may be generated for a mesh surface, and the mesh surface and other mesh surfaces have common model vertices. The step of “dividing the mesh surface on the target object model according to the vertex coordinate information to obtain the mesh surface set” may specifically include:
[0083] Acquire a first mesh surface, where the first mesh surface is a mesh surface on the target object model;
[0084] According to the vertex coordinate information of the vertex of the target model corresponding to the first mesh surface, query the second mesh surface containing the vertex of the target model;
[0085] A mesh surface set is generated based on the first mesh surface and the second mesh surface.
[0086] For example, the mesh surfaces of the target object model may be traversed. Assuming that mesh surface A is currently traversed, a query may be performed based on the vertex coordinate information of each model vertex of mesh surface A to determine whether there is a mesh surface with the same model vertex as that of mesh surface A, thereby obtaining a mesh surface set. Mesh surface A has common model vertices with each mesh surface in the mesh surface set. In other words, each mesh surface in the mesh surface set has common model vertices with mesh surface A.
[0087] Optionally, take the mesh surface as a triangular patch as an example, such as Figure 7 As shown in the figure, the vertex data of the model vertices can be traversed to obtain the vertex coordinate information and texture coordinate information of the three model vertices constituting the mesh surface, and a Loop structure can be formed. Based on the Loop structure, the corresponding mesh surface can be determined in the target object model, so a mesh surface can be represented by a Loop structure. The Loop structure can be as follows Figure 7 shown.
[0088] Generate an index based on the construction order of the Loop structure and build a Face structure based on the Loop structure and index. The Face structure can be as follows Figure 7 As shown, the vertex coordinate information of the three model vertices is used as the key to record the corresponding mesh faces. The Face structure and the map structure of the key and the mesh face (such as the index corresponding to the mesh face) are recorded through StructedMesh to generate a StructedMesh structure. The mesh faces on the target object model can be traversed through StructedMesh to obtain the mesh faces associated with the model vertices.
[0089] Based on StructedMesh, the mesh faces are traversed and the mesh faces associated with the model vertices can be queried according to the index in Face.
[0090] The specific method to get the mesh face set is as follows: Figure 8 As shown, StructedMesh is input into the program, and the program is used to generate a mesh face set, and traverse the StructedMesh, that is, traverse the mesh faces of the target object model, and the traversed mesh face is the first mesh face. It is determined whether the first mesh face has been traversed. If so, the first mesh face is skipped and the traversal is not repeated. If not, the first mesh face is marked as having been traversed, and the island list and the faceStack list are initialized based on the first mesh face. At this time, both the island list and the faceStack list contain the first mesh face.
[0091] faceStack pops the first mesh face, traverses the model vertices of the first mesh face, and searches for the mesh face that has the same model vertices as the first mesh face, that is, the second mesh face.
[0092] A mesh surface set is generated based on the first mesh surface and the second mesh surface.
[0093] In another embodiment, for mesh surface A, a query can be performed based on the vertex coordinate information of each model vertex of mesh surface A to determine whether there is a mesh surface subset B with the same model vertices as mesh surface A, and then mesh surfaces with common model vertices are queried based on the mesh surfaces in mesh surface subset B… The same operation is performed on other mesh surfaces, and the mesh surfaces of the target object model can be divided into at least one mesh surface set.
[0094] Any mesh face in a mesh face set shares model vertices with at least one mesh face in the mesh face set, that is, for any mesh face, there are other mesh faces in the mesh face set that have the same model vertices. Optionally, the number of common model vertices can also be set. For example, it can be set to have only one model vertex that is the same, or it can be set to have two model vertices that are the same.
[0095] 104. Screen the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands. The unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
[0096] Texture association can mean that in the unfolded mesh surfaces corresponding to the screened UV island, each unfolded mesh surface has the same texture coordinates of 1-3 model vertices as at least one unfolded mesh surface in the UV island, and the textures corresponding to the unfolded mesh surfaces in the UV island in the texture map are connected, so texture association can also be considered as texture adjacency or texture connection.
[0097] Among them, the normal direction can be determined according to the order of model vertices in the mesh surface, and the normal direction of the unfolded mesh surface can be determined according to the right-hand screw rule. For example, the order of model vertices A, B and C of one unfolded mesh surface is ABC, and the order of model vertices A, B and C of another unfolded mesh surface is CBA, then the normal directions of the two unfolded mesh surfaces are different.
[0098] In one embodiment, there is no mesh face in the mesh face set that has common model vertices with other mesh faces in the set. The mesh face set can be screened to obtain the UV island. Specifically, the mesh face set can be traversed. Assuming that the mesh face R is currently traversed, the mesh face K having the same texture coordinate information as the model vertices of the mesh face R is determined.
[0099] If K is equal to 0, the mesh surface R independently constitutes a UV island; if K≥1, it is determined whether the normals of the unfolded mesh surface corresponding to the mesh surface K are the same as those of the unfolded mesh surface of the mesh surface R, and the mesh surface K1 with the same normal is selected from the mesh surfaces. If K1 is equal to 0, the mesh surface R independently constitutes a UV island; if K1≥1, based on the mesh surface K1, the mesh surface P with the same texture coordinate information as the model vertex of the mesh surface K1 is queried, and the UV island can be obtained by continuous iteration. In the unfolded mesh surfaces corresponding to the UV island, each unfolded mesh surface corresponds to at least one unfolded plane that shares the model vertex with it.
[0100] In another embodiment, if there is a mesh surface in the mesh surface set that has common model vertices with other mesh surfaces, then the step of “screening the unfolded mesh surfaces corresponding to the mesh surfaces in the mesh surface set to obtain UV islands” may specifically include:
[0101] The mesh surface set is screened to obtain candidate mesh surfaces having the same texture coordinate information of at least one model vertex as the first mesh surface and the same normal direction of the unfolded mesh surface;
[0102] Update UV islands based on candidate mesh faces;
[0103] The candidate mesh surface is updated to the first mesh surface, and the query of the second mesh surface containing the target model vertices is returned according to the vertex coordinate information of the target model vertices corresponding to the first mesh surface, until no candidate mesh surface is screened out, and the UV island is obtained.
[0104] For example, the first mesh surface can be used as a mesh surface constituting the UV island. According to the texture coordinate information of the model vertices of the first mesh surface, candidate mesh surfaces are screened from the mesh surface set, which have at least one model vertex whose texture coordinates are the same as those of the first mesh surface, and whose normal of the unfolded mesh surface is the same as that of the unfolded mesh surface of the second mesh surface. Then, referring to the above process, the screening is continued based on the candidate mesh surfaces, and it is continuously iterated until no candidate mesh surfaces can be queried, and all the mesh surfaces constituting a UV island are obtained, that is, the UV island is obtained.
[0105] Optionally, you can Figure 8As shown, the mesh face set is traversed, the first mesh face can be the mesh face popped from the faceStack list, and it is determined whether the mesh faces in the mesh face set have been traversed. If so, the mesh face is skipped; if not, it is determined whether the texture coordinate information of at least one model vertex of the mesh face is the same as that of the first mesh face. If so, it is determined whether the unfolded mesh face of the mesh face has the same normal as the unfolded mesh face of the target mesh face. If so, the mesh face is a candidate mesh face, and the candidate mesh face is added to the island list and the faceStack list. The island list and the faceStack list are different stacks and the candidate mesh face is marked as traversed, and then the step of determining whether the faceStack list is empty is returned to execute. When the faceStack list is empty, the UV island is obtained according to the mesh faces in the island list.
[0106] In one embodiment, after the UV island is obtained, the edge line of the UV island can be marked in the unfolded two-dimensional plane, so that the quality inspector can determine the UV island corresponding to the target object model. That is, in one embodiment, the method for obtaining the model UV island provided in the embodiment of the present application can also specifically include:
[0107] On the two-dimensional unfolding plane, mark the edge lines of the UV island.
[0108] For example, a UV island can be considered as a group of adjacent faces or polygons, so each UV island can be considered to correspond to a cluster of unfolded mesh faces. The edge line of the UV island can be determined based on the texture coordinate information of the model vertices of the unfolded mesh faces in the UV island, and the edge line of the unfolded mesh face cluster belonging to the UV island in the two-dimensional unfolded surface plane can be annotated. In one example, the result of the edge line annotation processing can be as follows: Figure 2 As shown, the thick white lines are edge lines, based on which the corresponding unfolded mesh face clusters constituting the UV island can be determined.
[0109] The two-dimensional unfolding plane after edge line annotation processing can be displayed to the user through the client. The auditor who checks the UV unfolding effect of the target object model can confirm how to perform UV unfolding on the target object model in the texture mapping process according to the edge line, and then judge whether the UV unfolding of the target object model is reasonable and determine the UV unfolding effect of the target object model.
[0110] In addition to edge line annotation processing for the unfolded mesh face cluster in the two-dimensional unfolding plane, edge line annotation may also be performed on the target object model. The position of the edge line on the target object model may be determined based on vertex coordinate information of the model vertices on the edge line, and then annotation may be performed.
[0111] In addition, when a UV island is selected, the edge lines of the UV island connected to other UV islands can be displayed. That is, in one embodiment, each UV island corresponds to a cluster of mesh surfaces after unfolding. After the step of "marking the edge lines of the UV islands on the two-dimensional unfolding plane", the method provided in the embodiment of the present application further includes:
[0112] In response to a selection operation on the target expanded mesh face cluster, determining a first edge line of the target mesh face cluster and a second edge line matching the first edge line, the second edge line being an edge line of a different mesh face cluster, and the first edge line and the second edge line coincide on the target object model;
[0113] The first edge line and the connected second edge line are subjected to a first connection marking process.
[0114] If two UV islands of the target object model are connected together, there are the same edge lines or overlapping edge lines between the two UV islands. After the edge lines are two-dimensionally unfolded on different UV islands, they belong to different two-dimensional mesh surface clusters. The vertex coordinate information of the model vertices on the edge lines can be used as an index to record the edge lines of the unfolded mesh surface clusters. For example, the vertex coordinate information of the model vertices on the edge lines can be used as the key and the texture coordinate information can be used as the value to record the map structure, so as to find other UV islands with the same edge lines according to the index.
[0115] For example, in response to a selection operation on a target unfolded mesh surface cluster on a two-dimensional unfolded plane, an index corresponding to an edge line of the target unfolded mesh surface cluster can be determined, and a query can be made based on the index as to whether there are other UV island edge lines that are the same as the UV island corresponding to the target unfolded mesh surface cluster.
[0116] If the index of an edge line is partially or completely the same as the index corresponding to the target mesh surface cluster, it can be determined that the corresponding two UV islands are connected on the target object model, and the edge line is the second edge line. The first edge line and the second edge line are marked respectively and displayed through the client.
[0117] Optionally, the first adjacent annotation can be performed on the partial first edge line and the partial second edge corresponding to the same part in the index. For example, the index Y of the first edge line is abcdefg, the index U of the second edge line is abcdopqrdt, the same part of index Y and index U is abcd, the partial first edge line corresponding to the four model vertices abcd and the partial second edge line corresponding to the four model vertices abcd overlap on the target object model, and the partial first edge line and the partial second edge line are marked.
[0118] The first adjacent annotation can be highlighted, and text annotation or other processing that can mark the edge line in the two-dimensional unfolded plane is optional. The selected target unfolded mesh surface cluster can also be marked by color or the like. For example, the first edge line and the second edge line can be marked by blue lines, and other edge lines can be marked by green lines. The selected target unfolded mesh surface cluster is marked in red.
[0119] Optionally, an edge line may be determined in the target object model according to the four model vertices abcd and marked.
[0120] like Fig. 9 As shown, the expanded rectangular mesh face cluster is selected, its edge line connected to the fan-shaped one and the first edge line connected to other clusters are marked, and the second edge line of the fan-shaped one and the expanded rectangular mesh face cluster is marked, as shown in FIG. Fig. 9 As shown, the first edge line and the second edge line are marked by thick white lines, the other edge lines are marked by gray lines, and the thin white lines mark the connection lines of the mesh surfaces.
[0121] like Fig. 9 As shown in the figure, the side of the cylinder is divided into four islands, which correspond to a cluster of unfolded mesh faces in the two-dimensional unfolding plane, namely Fig. 9 The rectangular mesh face cluster shown is the common UV of the repeated components; the upper and lower surfaces of the cylinder are divided into 4 islands, and correspond to an unfolded mesh face cluster in the two-dimensional unfolding plane, that is Fig. 9 The fan-shaped mesh face cluster shown in the figure is the common UV of repeated components. Users can use it to evaluate the space utilization of the UV of the target object model during the mapping process.
[0122] In addition, according to Fig. 9 From the marked edge lines of the rectangular mesh face cluster shown, it can be seen that one of the edges is unmarked, which means that the two UV islands corresponding to the rectangular mesh face cluster are connected together based on the unmarked edge line, that is, symmetric UV is used, so the corresponding second edge line cannot be found in the unfolded mesh face. Based on this, it is also possible to evaluate whether the target object model uses symmetric UV during the mapping process.
[0123] Reviewers can clearly know the UV island composition of the target object model and the corresponding mesh surface cluster after unfolding, and can also know which edge lines connect the connected UV islands, and thus can judge the UV unfolding effect of the target object model.
[0124] Optionally, the edge lines of the target object model may also be marked so as to determine the mapping result of the edge lines on the target object model on the texture map. That is, in one embodiment, after the step of "in response to the selection operation on the target unfolded mesh surface cluster, determining the first edge line in the target unfolded mesh surface cluster and the second edge line matching the first edge line", the method further includes:
[0125] Determine a corresponding edge line in the target object model according to vertex coordinate information corresponding to the first edge line and the second edge line;
[0126] A second connection labeling process is performed on the corresponding edge lines in the target object model to identify the connected edge lines in the target object model.
[0127] For example, specifically, the position of the first edge line in the target object model can be determined based on the vertex coordinate information of the model vertices on the first edge line and marked, and the position of the second edge line in the target object model can be determined based on the vertex coordinate information of the model vertices on the second edge line and marked and displayed on the target object model displayed on the client.
[0128] Optionally, the corresponding edge line may be determined and marked in the target object model according to the same partial index of the index of the first edge line and the index of the second edge line.
[0129] After marking the edge lines on the target object model, the reviewer can clearly understand how the different UV islands of the target object model are connected, and then judge the UV unfolding effect.
[0130] Optionally, you can Fig.10 The position correspondence between the texture map and the target object model is shown to the user in real time. For example, when it is detected that the mouse is clicked or hovered on the target object model or the two-dimensional unfolded plane, the texture coordinate information corresponding to the mouse position can be determined. According to the texture coordinate information of the mouse position, an anchor point can be drawn on the texture map and mapped to the target object model, so as to display the anchor point on the two-dimensional unfolded plane and the target object model, so as to determine the position correspondence between the texture map and the target object model.
[0131] Optionally, a dynamic map may be generated according to the mouse position so that the position of the anchor point in the texture map changes with the mouse position, and the position correspondence between the texture map and the target object model may be displayed to the user in real time through Canvas.
[0132] As can be seen from the above, the embodiment of the present application obtains the vertex coordinate information and the corresponding texture coordinate information of the model vertices of the mapped target object model; unfolds the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolded plane, and the two-dimensional unfolded plane includes the unfolded mesh surface of the target object model; divides the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, and any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; screens the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands, and the unfolded mesh surfaces corresponding to the UV islands have the same normals and are texture-related; based on the texture coordinate information, performs edge line annotation processing on the unfolded mesh surface clusters corresponding to the UV islands in the two-dimensional unfolded plane.
[0133] The mesh faces of the UV island are interconnected in the three-dimensional model, and the corresponding meshes after unfolding are also interconnected. Therefore, the embodiment of the present application can obtain a set of mesh faces that are interconnected through model vertices on the target object model based on the vertex coordinate information of the model vertices of the target object model, and then filter out the mesh faces with adjacent textures and the same normals, so as to accurately obtain the UV island of the target object model. The present application obtains the UV island based on the vertex coordinate information and texture coordinate information of the target object model, and there is no situation where the information cannot be obtained. The accuracy of obtaining the UV island can be improved, so that the UV unfolding result of the target object model can be accurately displayed, thereby improving the effect of the reviewer's evaluation of the UV unfolding effect of the target object model.
[0134] In order to facilitate better implementation of the method for obtaining the model UV island provided in the embodiment of the present application, a device for obtaining the model UV island is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned method for obtaining the model UV island, and the specific implementation details can refer to the description in the method embodiment.
[0135] The device for obtaining the model UV island can be integrated into a computer device, such as Fig.11 As shown, the device for acquiring the model UV island may include: an acquisition unit 301, an expansion unit 302, a division unit 303 and a screening unit 304, which are specifically as follows:
[0136] (1) An acquisition unit 301 is used to acquire vertex coordinate information and corresponding texture coordinate information of model vertices of a target object model that has been mapped.
[0137] (2) An unfolding unit 302, which is used to unfold the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolding plane, which includes the unfolded mesh surface of the target object model.
[0138] In one embodiment, the expansion unit 302 may include:
[0139] The first texture acquisition subunit is used to acquire a texture map corresponding to the target object model and mark a preset texture area in the texture map;
[0140] The first map expansion subunit is used to expand the target object model on the texture map according to the texture coordinate information to obtain a two-dimensional expansion plane expanded on the texture map, so as to determine whether the two-dimensional expansion plane is located in a preset map area.
[0141] In one embodiment, the expansion unit 302 may include:
[0142] The second map acquisition subunit is used to acquire a preset grid map, wherein the grid map includes a plurality of grid image areas distributed in a chessboard shape, the colors of adjacent grid image areas are different, and each grid image area has a direction mark;
[0143] The second texture expansion subunit is used to expand the target object model on the grid map according to the texture coordinate information to obtain a two-dimensional expansion plane expanded on the grid map;
[0144] The texture rendering subunit is used to render the grid map onto the target object model according to the correspondence between the two-dimensional unfolding plane and the grid map, so as to determine the distribution and rendering direction of the grid image area on the target object model.
[0145] (3) A division unit 303 is used to divide the mesh surfaces on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set.
[0146] In one embodiment, the dividing unit 303 may include:
[0147] A mesh surface acquisition subunit is used to acquire a first mesh surface, where the first mesh surface is a mesh surface on a target object model;
[0148] A query subunit, configured to query a second mesh surface including a vertex of the target model according to vertex coordinate information of the vertex of the target model corresponding to the first mesh surface;
[0149] The generating subunit is used to generate a mesh surface set based on the first mesh surface and the second mesh surface.
[0150] (4) A screening unit 304 is used to screen the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands. The unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
[0151] In one embodiment, the screening unit 304 may include:
[0152] A mesh screening subunit, used to screen the mesh face set to obtain a candidate mesh face having the same texture coordinate information of at least one model vertex as the first mesh face and the same normal direction of the mesh face after unfolding;
[0153] An update subunit, used to update the UV island according to the candidate mesh faces;
[0154] The loop subunit is used to update the candidate mesh surface to the first mesh surface, and return to execute according to the vertex coordinate information of the target model vertex corresponding to the first mesh surface, query the second mesh surface containing the target model vertex, until no candidate mesh surface is screened out, and the UV island is obtained.
[0155] In one embodiment, the device for acquiring the model UV island provided in the embodiment of the present application may further include a labeling unit for performing edge line labeling processing on the UV island on the two-dimensional unfolding plane.
[0156] In one embodiment, the model UV island acquisition device provided in the embodiment of the present application may also include:
[0157] A selection unit, configured to, in response to a selection operation on a target expanded mesh surface cluster, determine a first edge line in the target expanded mesh surface cluster and a second edge line matching the first edge line, wherein the second edge line is an edge line of a different mesh surface cluster, and the first edge line and the second edge line overlap on the target object model;
[0158] The first marking unit is used to perform a first connection marking process on the first edge line and the second edge line.
[0159] In one embodiment, the model UV island acquisition device provided in the embodiment of the present application may also include:
[0160] An edge line determining unit, configured to determine a corresponding edge line in a target object model according to vertex coordinate information corresponding to the first edge line and the second edge line;
[0161] The second unit is used to perform a second connection marking process on the corresponding edge lines in the target object model to identify the connected edge lines in the target object model.
[0162] As can be seen from the above, the device for acquiring the UV island of the model in the embodiment of the present application acquires the vertex coordinate information and the corresponding texture coordinate information of the model vertices of the mapped target object model through the acquisition unit 301; the unfolding unit 302 unfolds the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolded plane, and the two-dimensional unfolded plane includes the unfolded mesh surface of the target object model; the division unit 303 divides the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, and any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; the screening unit 304 screens the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands, and the unfolded mesh surfaces corresponding to the UV islands have the same normals and are texture-related.
[0163] The mesh faces of the UV island are interconnected in the three-dimensional model, and the corresponding meshes after unfolding are also interconnected. Therefore, the embodiment of the present application can obtain a set of mesh faces that are interconnected through model vertices on the target object model based on the vertex coordinate information of the model vertices of the target object model, and then filter out the mesh faces with adjacent textures and the same normals, so as to accurately obtain the UV island of the target object model. The present application obtains the UV island based on the vertex coordinate information and texture coordinate information of the target object model, and there is no situation where the information cannot be obtained. The accuracy of obtaining the UV island can be improved, so that the UV unfolding result of the target object model can be accurately displayed, thereby improving the effect of the reviewer's evaluation of the UV unfolding effect of the target object model.
[0164] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Fig.12 As shown, Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0165] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
[0166] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0167] Obtaining vertex coordinate information and corresponding texture coordinate information of model vertices of the mapped target object model;
[0168] Performing two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes the unfolded mesh surface of the target object model;
[0169] The mesh faces on the target object model are divided according to the vertex coordinate information to obtain a mesh face set, wherein any mesh face in the mesh face set has a common model vertex with at least one mesh face in the same set;
[0170] The unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set are screened to obtain UV islands. The unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
[0171] In one embodiment, the step of “dividing the mesh surface on the target object model using vertex coordinate information to obtain a mesh surface set” may include:
[0172] Acquire a first mesh surface, where the first mesh surface is a mesh surface on the target object model;
[0173] According to the vertex coordinate information of the vertex of the target model corresponding to the first mesh surface, query the second mesh surface containing the vertex of the target model;
[0174] A mesh surface set is generated based on the first mesh surface and the second mesh surface.
[0175] In one embodiment, the step of “screening the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands” may include:
[0176] The mesh surface set is screened to obtain candidate mesh surfaces having the same texture coordinate information of at least one model vertex as the first mesh surface and the same normal direction of the unfolded mesh surface;
[0177] Update UV islands based on candidate mesh faces;
[0178] The candidate mesh surface is updated to the first mesh surface, and the query of the second mesh surface containing the target model vertices is returned according to the vertex coordinate information of the target model vertices corresponding to the first mesh surface, until no candidate mesh surface is screened out, and the UV island is obtained.
[0179] In one embodiment, the method for obtaining the model UV island provided in the embodiment of the present application may further include: performing edge line marking processing on the UV island on the two-dimensional unfolding plane.
[0180] In one embodiment, before the step of “performing edge line marking processing on the UV island on the two-dimensional unfolded plane”, the model UV island acquisition method provided in the embodiment of the present application may further include:
[0181] In response to a selection operation on the target unfolded mesh surface cluster, determining a first edge line in the target unfolded mesh surface cluster and a second edge line matching the first edge line, the second edge line being an edge line of a different mesh surface cluster, and the first edge line and the second edge line coincide on the target object model;
[0182] The first edge line and the second edge line are subjected to a first connection marking process.
[0183] In one embodiment, after the step of “in response to a selection operation on a target unfolded mesh surface cluster, determining a first edge line in the target unfolded mesh surface cluster and a second edge line matching the first edge line”, the model UV island acquisition method provided in the embodiment of the present application may further include:
[0184] Determine a corresponding edge line in the target object model according to vertex coordinate information corresponding to the first edge line and the second edge line;
[0185] A second connection labeling process is performed on the corresponding edge lines in the target object model to identify the connected edge lines in the target object model.
[0186] In one embodiment, the step of “two-dimensionally unfolding the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane” may include:
[0187] Obtain the texture map corresponding to the target object model, and mark the preset map area in the texture map;
[0188] The target object model is unfolded on the texture map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the texture map, so as to determine whether the two-dimensional unfolding plane is located in a preset mapping area.
[0189] In one embodiment, the step of “two-dimensionally unfolding the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane” may include:
[0190] Obtain a preset checkered map, wherein the checkered map includes a plurality of checkered image areas distributed in a chessboard shape, adjacent checkered image areas have different colors, and each checkered image area has a direction mark;
[0191] Unfolding the target object model on the grid map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the grid map;
[0192] According to the correspondence between the two-dimensional unfolded plane and the grid map, the grid map is drawn onto the target object model, so as to determine the distribution and drawing direction of the grid image area on the target object model.
[0193] As can be seen from the above, the embodiment of the present application obtains the vertex coordinate information and the corresponding texture coordinate information of the model vertices of the mapped target object model; unfolds the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolded plane, and the two-dimensional unfolded plane includes the unfolded mesh surface of the target object model; divides the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, and any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; and screens the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands, and the unfolded mesh surfaces corresponding to the UV islands have the same normals and are texture-related.
[0194] The mesh faces of the UV island are interconnected in the three-dimensional model, and the corresponding meshes after unfolding are also interconnected. Therefore, the embodiment of the present application can obtain a set of mesh faces that are interconnected through model vertices on the target object model based on the vertex coordinate information of the model vertices of the target object model, and then filter out the mesh faces with adjacent textures and the same normals, so as to accurately obtain the UV island of the target object model. The present application obtains the UV island based on the vertex coordinate information and texture coordinate information of the target object model, and there is no situation where the information cannot be obtained. The accuracy of obtaining the UV island can be improved, so that the UV unfolding result of the target object model can be accurately displayed, thereby improving the effect of the reviewer's evaluation of the UV unfolding effect of the target object model.
[0195] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0196] Optional, such as Fig.12 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Fig.12 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0197] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of computer equipment, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.
[0198] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0199] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.
[0200] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0201] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0202] although Fig.12 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0203] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0204] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0205] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any virtual item marking method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0206] Obtaining vertex coordinate information and corresponding texture coordinate information of model vertices of the mapped target object model;
[0207] Performing two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes the unfolded mesh surface of the target object model;
[0208] The mesh faces on the target object model are divided according to the vertex coordinate information to obtain a mesh face set, wherein any mesh face in the mesh face set has a common model vertex with at least one mesh face in the same set;
[0209] The unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set are screened to obtain UV islands. The unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
[0210] In one embodiment, the step of “dividing the mesh surface on the target object model using vertex coordinate information to obtain a mesh surface set” may include:
[0211] Acquire a first mesh surface, where the first mesh surface is a mesh surface on the target object model;
[0212] According to the vertex coordinate information of the vertex of the target model corresponding to the first mesh surface, query the second mesh surface containing the vertex of the target model;
[0213] A mesh surface set is generated based on the first mesh surface and the second mesh surface.
[0214] In one embodiment, the step of “screening the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands” may include:
[0215] The mesh surface set is screened to obtain candidate mesh surfaces having the same texture coordinate information of at least one model vertex as the first mesh surface and the same normal direction of the unfolded mesh surface;
[0216] Update UV islands based on candidate mesh faces;
[0217] The candidate mesh surface is updated to the first mesh surface, and the query of the second mesh surface containing the target model vertices is returned according to the vertex coordinate information of the target model vertices corresponding to the first mesh surface, until no candidate mesh surface is screened out, and the UV island is obtained.
[0218] In one embodiment, the method for obtaining the model UV island provided in the embodiment of the present application may further include: performing edge line marking processing on the UV island on the two-dimensional unfolding plane.
[0219] In one embodiment, after the step of “performing edge line marking processing on the UV island on the two-dimensional unfolded plane”, the model UV island acquisition method provided in the embodiment of the present application may further include:
[0220] In response to a selection operation on the target unfolded mesh surface cluster, determining a first edge line in the target unfolded mesh surface cluster and a second edge line matching the first edge line, the second edge line being an edge line of a different mesh surface cluster, and the first edge line and the second edge line coincide on the target object model;
[0221] The first edge line and the second edge line are subjected to a first connection marking process.
[0222] In one embodiment, after the step of “in response to a selection operation on a target unfolded mesh surface cluster, determining a first edge line in the target unfolded mesh surface cluster and a second edge line matching the first edge line”, the model UV island acquisition method provided in the embodiment of the present application may further include:
[0223] Determine a corresponding edge line in the target object model according to vertex coordinate information corresponding to the first edge line and the second edge line;
[0224] A second connection labeling process is performed on the corresponding edge lines in the target object model to identify the connected edge lines in the target object model.
[0225] In one embodiment, the step of “two-dimensionally unfolding the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane” may include:
[0226] Obtain the texture map corresponding to the target object model, and mark the preset map area in the texture map;
[0227] The target object model is unfolded on the texture map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the texture map, so as to determine whether the two-dimensional unfolding plane is located in a preset mapping area.
[0228] In one embodiment, the step of “two-dimensionally unfolding the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane” may include:
[0229] Obtain a preset checkered map, wherein the checkered map includes a plurality of checkered image areas distributed in a chessboard shape, adjacent checkered image areas have different colors, and each checkered image area has a direction mark;
[0230] Unfolding the target object model on the grid map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the grid map;
[0231] According to the correspondence between the two-dimensional unfolded plane and the grid map, the grid map is drawn onto the target object model, so as to determine the distribution and drawing direction of the grid image area on the target object model.
[0232] As can be seen from the above, the embodiment of the present application obtains the vertex coordinate information and the corresponding texture coordinate information of the model vertices of the mapped target object model; unfolds the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolded plane, and the two-dimensional unfolded plane includes the unfolded mesh surface of the target object model; divides the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, and any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; and screens the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands, and the unfolded mesh surfaces corresponding to the UV islands have the same normals and are texture-related.
[0233] The mesh faces of the UV island are interconnected in the three-dimensional model, and the corresponding meshes after unfolding are also interconnected. Therefore, the embodiment of the present application can obtain a set of mesh faces that are interconnected through model vertices on the target object model based on the vertex coordinate information of the model vertices of the target object model, and then filter out the mesh faces with adjacent textures and the same normals, so as to accurately obtain the UV island of the target object model. The present application obtains the UV island based on the vertex coordinate information and texture coordinate information of the target object model, and there is no situation where the information cannot be obtained. The accuracy of obtaining the UV island can be improved, so that the UV unfolding result of the target object model can be accurately displayed, thereby improving the effect of the reviewer's evaluation of the UV unfolding effect of the target object model.
[0234] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0235] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0236] The above is a detailed introduction to a method, device, computer equipment and computer storage medium for obtaining a model UV island provided in an embodiment of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for obtaining a model UV island, characterized in that: include: Obtaining vertex coordinate information and corresponding texture coordinate information of model vertices of the mapped target object model; Performing two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes an unfolded mesh surface of the target object model; Dividing the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; The unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set are screened to obtain UV islands, wherein the unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
2. The method according to claim 1, characterized in that The step of dividing the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set includes: Acquire a first mesh surface, where the first mesh surface is a mesh surface on the target object model; According to the vertex coordinate information of the target model vertex corresponding to the first mesh surface, querying the second mesh surface containing the target model vertex; The mesh surface set is generated based on the first mesh surface and the second mesh surface.
3. The method according to claim 2, characterized in that The step of screening the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands includes: Screening the mesh surface set to obtain candidate mesh surfaces having the same texture coordinate information of at least one model vertex as the first mesh surface and the same normal direction of the unfolded mesh surface; Updating the UV island according to the candidate mesh surface; The candidate mesh surface is updated to the first mesh surface, and the vertex coordinate information of the target model vertices corresponding to the first mesh surface is returned to execute, and a second mesh surface containing the target model vertices is queried until no candidate mesh surface is screened out, thereby obtaining the UV island.
4. The method according to claim 1, characterized in that The method further comprises: On the two-dimensional unfolding plane, edge line marking processing is performed on the UV island.
5. The method according to claim 4, characterized in that Each UV island corresponds to a cluster of unfolded mesh surfaces. After edge line marking processing is performed on the two-dimensional unfolded plane, the method further includes: In response to a selection operation on a target unfolded mesh surface cluster, determining a first edge line in the target unfolded mesh surface cluster and a second edge line matching the first edge line, wherein the second edge line is an edge line of a different mesh surface cluster, and the first edge line and the second edge line overlap on the target object model; The first edge line and the second edge line are subjected to a first connection marking process.
6. The method according to claim 5, characterized in that After determining the first edge line in the target unfolded mesh surface cluster and the second edge line matching the first edge line in the target unfolded mesh surface cluster in response to the selection operation on the target unfolded mesh surface cluster, the method further includes: Determining corresponding edge lines in the target object model according to vertex coordinate information corresponding to the first edge line and the second edge line; A second connection labeling process is performed on the corresponding edge lines in the target object model to identify the connected edge lines in the target object model.
7. The method according to any one of claims 1 to 6, characterized in that: The step of performing two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane includes: Obtaining a texture map corresponding to the target object model, and marking a preset map area in the texture map; The target object model is unfolded on the texture map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the texture map, so as to determine whether the two-dimensional unfolding plane is located in the preset map area.
8. The method according to any one of claims 1 to 6, characterized in that: The step of performing two-dimensional unfolding of the target object model according to the texture coordinate information to obtain a two-dimensional unfolding plane includes: Obtaining a preset grid map, wherein the grid map includes a plurality of grid image areas distributed in a chessboard shape, adjacent grid image areas have different colors, and each grid image area has a direction mark; Unfolding the target object model on the grid map according to the texture coordinate information to obtain a two-dimensional unfolding plane unfolded on the grid map; According to the correspondence between the two-dimensional unfolding plane and the grid map, the grid map is drawn onto the target object model, so as to determine the distribution and drawing direction of the grid image area on the target object model.
9. A device for acquiring a model UV island, characterized in that: include: An acquisition unit, used for acquiring vertex coordinate information and corresponding texture coordinate information of model vertices of the mapped target object model; an unfolding unit, configured to unfold the target object model in two dimensions according to the texture coordinate information to obtain a two-dimensional unfolding plane, wherein the two-dimensional unfolding plane includes an unfolded mesh surface of the target object model; A division unit, configured to divide the mesh surface on the target object model according to the vertex coordinate information to obtain a mesh surface set, wherein any mesh surface in the mesh surface set has a common model vertex with at least one mesh surface in the same set; The screening unit is used to screen the unfolded mesh surfaces corresponding to the mesh surfaces of the mesh surface set to obtain UV islands, wherein the unfolded mesh surfaces corresponding to the UV islands have the same normal and associated textures.
10. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the method for obtaining the model UV island according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the method for obtaining a model UV island according to any one of claims 1 to 8.