Data processing method and device, equipment and computer readable storage medium
By reducing the dimensionality of 3D mesh data and storing it in layers, a sub-mesh hierarchical structure is constructed, which solves the problem of long rendering time and achieves efficient rendering results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-01-17
- Publication Date
- 2026-06-26
AI Technical Summary
In computer graphics applications, the high computational cost of rendering 3D mesh data in existing technologies leads to long rendering times and display stuttering issues.
By performing dimensionality reduction on the 3D mesh data, a sub-mesh hierarchical structure is constructed. Based on the 2D mesh data, triangles are grouped and stored hierarchically. The cross-sectional rings of the sub-mesh are pre-rendered, improving rendering efficiency.
Reduce computational load, improve rendering efficiency, reduce rendering time, avoid display lag, and achieve efficient virtual object rendering.
Smart Images

Figure CN116486033B_ABST
Abstract
Description
Technical Field
[0001] This application relates to data processing technology, and more particularly to a data processing method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] In computer graphics applications, high-precision 3D mesh data is often required to realistically represent virtual objects. However, the complexity of the data directly affects the computational cost during rendering. Furthermore, in related technologies, the 3D mesh data is rendered as a whole when rendering virtual objects. When the virtual object needs to be decomposed for display, complex calculations are required on the entire 3D mesh data, resulting in longer rendering times and causing display stuttering. Summary of the Invention
[0003] This application provides a data processing method, apparatus, and computer-readable storage medium that can improve rendering efficiency.
[0004] The technical solution of this application embodiment is implemented as follows:
[0005] This application provides a data processing method, including:
[0006] Acquire the three-dimensional mesh data to be processed, and perform dimensionality reduction processing on the three-dimensional mesh data to obtain two-dimensional mesh data, wherein the two-dimensional mesh data includes vertex information and triangle information;
[0007] Based on the two-dimensional grid data, a sub-grid hierarchical structure is constructed, wherein each level of the sub-grid structure includes at least one sub-grid;
[0008] Based on each subgrid, the two-dimensional grid data is triangularly grouped to obtain the triangular group set corresponding to each subgrid;
[0009] Each subgrid and the corresponding triangle group set are stored hierarchically according to the subgrid hierarchy.
[0010] Based on the vertex information and the triangle information, the cross-sectional ring of each sub-mesh is determined, and based on the cross-sectional ring of each sub-mesh, the cross-section of each sub-mesh is rendered in advance.
[0011] This application provides a data processing apparatus, including:
[0012] The dimension reduction module is used to acquire the three-dimensional mesh data to be processed, and to perform dimension reduction processing on the three-dimensional mesh data to obtain two-dimensional mesh data, wherein the two-dimensional mesh data includes vertex information and triangle information.
[0013] A hierarchical construction module is used to construct a sub-mesh hierarchical structure based on the two-dimensional mesh data, wherein each level of the sub-mesh structure includes at least one sub-mesh;
[0014] The triangle grouping module is used to perform triangle grouping on the two-dimensional grid data based on each sub-grid to obtain a set of triangle groups corresponding to each sub-grid.
[0015] The hierarchical storage module is used to store each sub-grid and the corresponding triangle group set according to the sub-grid hierarchy.
[0016] The first determining module is used to determine the cross-sectional ring of each sub-mesh based on the vertex information and the triangle information, and to pre-render the cross-section of each sub-mesh based on the cross-sectional ring of each sub-mesh.
[0017] In some embodiments, the dimensionality reduction module is further configured to:
[0018] Obtain the preset conformal mapping function;
[0019] Obtain the three-dimensional coordinate information of each vertex from the three-dimensional mesh data;
[0020] The three-dimensional coordinate information of each vertex is conformally mapped using the conformal mapping function to obtain the two-dimensional coordinate information of each vertex.
[0021] In some embodiments, the hierarchical building module is further configured to:
[0022] The grid corresponding to the two-dimensional grid data is determined as the first-level sub-grid;
[0023] Obtain the vertex coordinates and center coordinates of the target region corresponding to each sub-grid of the i-th level, i=1,2,...,(N-1), where N is the preset number of levels and N is an integer greater than 1;
[0024] Based on the vertex coordinates and center coordinates of the i-th target region, the i-th level sub-grids are divided to obtain multiple (i+1)-th level sub-grids.
[0025] In some embodiments, the triangle grouping module is further configured to:
[0026] The center coordinates of each triangle are determined based on the vertex information and the triangle information.
[0027] The vertex coordinates of the j-th subgrid are obtained based on the region information of each subgrid, where j = 1, 2, ..., M, M is the total number of subgrids, and M is a positive integer;
[0028] Based on the center coordinates of each triangle and the vertex coordinates of the j-th subgrid, the triangles whose center coordinates are located in the target region corresponding to the j-th subgrid are added to the triangle grouping set corresponding to the j-th subgrid.
[0029] In some embodiments, the triangle grouping module is further configured to:
[0030] Based on the vertex information and the triangle information, the coordinates of the three vertices of each triangle are determined, wherein the vertex coordinates include the coordinate values of the first vertex and the second vertex.
[0031] The first center coordinates of each triangle are determined based on the coordinates of the three first vertices of each triangle.
[0032] The second center coordinates of each triangle are determined based on the coordinates of the three second vertices of each triangle.
[0033] In some embodiments, the first determining module is further configured to:
[0034] Based on the vertex information and the triangle information, the target edge in each triangle group set is determined, and the target edge is the edge that exists in only one triangle;
[0035] From the multiple target edges in each of the triangle group sets, determine the target edges that are connected end to end and can form a closed loop;
[0036] Each closed loop is defined as a cross-sectional loop of each sub-grid.
[0037] In some embodiments, the first determining module is further configured to:
[0038] Based on the vertex information and the triangle information, determine each connecting edge in the k-th triangle group set, k=1,2,...,M, where M is the total number of sub-grids and M is a positive integer;
[0039] The number of times each connecting edge is shared is determined based on the triangle information;
[0040] The connecting edge with a common frequency of the first preset value is determined as the target edge in the k-th triangle set.
[0041] In some embodiments, the first determining module is further configured to:
[0042] Set the number of times each of the connected edges is used together to a first preset value;
[0043] When there is a second connecting edge among the other connecting edges besides the first connecting edge that has the same vertex as the first connecting edge but in the opposite direction, the number of times the first connecting edge is used is updated to a second preset value; wherein, the first connecting edge is any one of the connecting edges.
[0044] In some embodiments, the device further includes:
[0045] The first acquisition module is used to acquire the first target level selected when rendering the virtual object corresponding to the two-dimensional grid data;
[0046] The second acquisition module is used to acquire at least one target sub-mesh to be rendered in the first target level;
[0047] The first rendering module is used to render the at least one target sub-mesh to obtain a first rendering result.
[0048] In some embodiments, the device further includes:
[0049] The second determining module is used to determine the second target level to be used when rendering the virtual object when it is determined that the virtual object rendered based on the two-dimensional grid data has reached the decomposition condition.
[0050] The third determining module is used to determine the movement and rotation information of each sub-grid in the second target level;
[0051] The fourth determining module is used to determine the rendering position of each sub-mesh based on the movement and rotation information of each sub-mesh;
[0052] The second rendering module is used to render each sub-mesh based on the rendering position to obtain a second rendering result.
[0053] This application provides a computer device, including:
[0054] Memory, used to store executable instructions;
[0055] The processor, when executing executable instructions stored in the memory, implements the data processing method provided in the embodiments of this application.
[0056] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the data processing method provided in this application.
[0057] This application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the data processing method provided in this application.
[0058] The embodiments of this application have the following beneficial effects:
[0059] After obtaining the 3D mesh data to be processed, the 3D mesh data is first reduced in dimensionality to obtain 2D mesh data, which includes vertex information and triangle information. Subsequent processing is then performed based on the 2D mesh data, which can effectively reduce the amount of computation and improve computational efficiency. Then, based on the 2D mesh data, a sub-mesh hierarchical structure is constructed, wherein each level of the sub-mesh structure includes at least one sub-mesh. Then, based on the region information of each sub-mesh, the triangles in the 2D mesh data are grouped to obtain the triangle group set corresponding to each sub-mesh. The sub-mesh and the triangle group set corresponding to each sub-mesh are stored hierarchically according to the sub-mesh hierarchy. Finally, based on the vertex information and the triangle information, the cross-sectional ring of each sub-mesh is determined, and based on the cross-sectional ring of each sub-mesh, the cross-section of each sub-mesh is rendered in advance. Since the sub-mesh structure at different levels includes a different number of sub-mesh, that is, the sub-mesh at different levels is divided into sub-mesh according to different granularities, and each sub-mesh and the corresponding triangle group set are stored in layers according to the sub-mesh level, when it is necessary to render sub-mesh of different granularities, the corresponding layer structure can be directly obtained. Furthermore, since the cross-section of each triangle group set has been rendered in advance, when it is necessary to decompose the rendering, there is no need to perform calculations again, but to display it directly, thereby improving the rendering efficiency. Attached Figure Description
[0060] Figure 1A This is a schematic diagram of vertices, edges, and faces;
[0061] Figure 1B This is a schematic diagram of a 3D mesh.
[0062] Figure 1C This is a schematic diagram of a two-dimensional grid.
[0063] Figure 1D This is a schematic diagram of a subgrid.
[0064] Figure 1E A schematic diagram illustrating the process of dividing a 3D mesh to obtain a spatially layered data structure;
[0065] Figure 1F This is a schematic diagram illustrating the spatial hierarchical data structure obtained by dividing a two-dimensional grid.
[0066] Figure 1G This is a schematic diagram of conformal mapping;
[0067] Figure 1H This is a schematic diagram of a cross-section;
[0068] Figure 1I This is a schematic diagram of the outline ring of the cross section;
[0069] Figure 2 This is a schematic diagram of the data processing system architecture provided in the embodiments of this application;
[0070] Figure 3 This is a schematic diagram of the structure of the server 400 provided in an embodiment of this application;
[0071] Figure 4 A schematic flowchart of a data processing method provided in an embodiment of this application;
[0072] Figure 5 This is a schematic diagram illustrating the implementation process of constructing a sub-mesh hierarchical structure provided in an embodiment of this application;
[0073] Figure 6A This is a schematic diagram illustrating the implementation process of layered rendering using the data processing method provided in the embodiments of this application;
[0074] Figure 6B This is a schematic diagram illustrating the implementation process of decomposition rendering using the data processing method provided in the embodiments of this application;
[0075] Figure 6C This is a schematic diagram illustrating the application of decomposed rendering provided in an embodiment of this application;
[0076] Figure 6D Another flowchart illustrating the data processing method provided in this application embodiment;
[0077] Figure 7 A schematic diagram illustrating the implementation process of the dimensionality reduction process provided in the embodiments of this application;
[0078] Figure 8 The steps shown determine the center coordinates of each triangle in the grid;
[0079] Figure 9A This is a schematic diagram illustrating the implementation process of constructing a sub-mesh hierarchy provided in an embodiment of this application;
[0080] Figure 9B A schematic diagram illustrating the implementation logic of the sub-mesh hierarchy construction function provided in this application embodiment;
[0081] Figure 9C A schematic diagram of the sub-grid layered structure provided in the embodiments of this application;
[0082] Figure 10A A schematic diagram illustrating the implementation process of the main triangle grouping provided in this application embodiment;
[0083] Figure 10B A schematic diagram illustrating the implementation logic of the AddTriangle function provided in this application embodiment;
[0084] Figure 11A A schematic diagram illustrating the implementation process of the computational cross-section ring provided in this application embodiment;
[0085] Figure 11B This is a schematic diagram illustrating the implementation logic of the section ring creation function provided in an embodiment of this application. Detailed Implementation
[0086] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0087] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0088] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0089] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0090] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0091] 1) Vertex: is a data structure containing a 2D position vector [x, y] or a 3D position vector [x, y, z].
[0092] 2) Face: is a data structure containing 3 index integers, where the index indicates the vertex used by the face vertex.
[0093] 3) Edges: Each face has 3 edges. An edge is a data structure containing 2 indexed integers. Figure 1A This is a schematic diagram of vertices, edges, and faces. Figure 1AIt includes three vertices 0, 1, and 2, three edges [0,1], [1,2], and [2,0], and one face [0,1,2].
[0094] 4) Mesh: This is a common method for displaying 3D game objects. A mesh is a data structure that contains an array of vertices and an array of faces.
[0095] 5) A 3D mesh is a data structure that contains an array of vertices and an array of faces. Figure 1B This is a schematic diagram of a 3D mesh. Figure 1B In the 3D mesh shown, each vertex contains a 3D spatial vector representing the vertex's position [x, y, z].
[0096] 6) A two-dimensional mesh is a data structure that contains an array of vertices and an array of faces. Figure 1C This is a schematic diagram of a two-dimensional grid. Figure 1C In the two-dimensional grid shown, each vertex contains a 2-dimensional spatial vector representing the vertex's position [x, y].
[0097] 7) Sub-mesh is a smaller mesh separated from the main mesh. Figure 1D This is a schematic diagram of a subgrid. Figure 1D Including from Figure 1B The two sub-mesh separated from the 3D mesh shown.
[0098] 8) Three-dimensional spatial hierarchical data structure: Through spatial partitioning and other means, the three-dimensional vertices are grouped and placed in separate data structures. Figure 1E A schematic diagram illustrating the spatial hierarchical data structure obtained by segmenting a 3D mesh, such as... Figure 1E As shown, dividing the 3D mesh 131 yields 132 and 133, and further dividing 132 yields 1321 and 1322.
[0099] 9) Two-dimensional spatial hierarchical data structure: Through spatial partitioning and other means, two-dimensional vertices are grouped and placed in separate data structures. Figure 1F This is a schematic diagram illustrating the spatial hierarchical data structure obtained by dividing a two-dimensional grid, as shown below. Figure 1F As shown, dividing the two-dimensional grid 141 yields 142 and 143, and further dividing 142 yields 1421 and 1422.
[0100] 10) A conformal map, also known as a conformal transformation or conformal mapping, originates from concepts in fluid mechanics and geometry. It is a mapping that preserves angles. A mapping that preserves the orientation angles and directions of the curves it traverses can be called a conformal (or conformal) transformation. Conformal transformations preserve angles and the shape of infinitesimal objects, but not necessarily their dimensions. The conformal property can be described in terms of the Jacobian matrix, the derivative matrix of the coordinate transformation. If the Jacobian matrix of the transformation is everywhere a scalar multiplied by a rotation matrix, then the transformation is conformal. Figure 1G This is a schematic diagram of conformal mapping.
[0101] 11) Triangle vertex indexing: The mesh contains an array of vertices, each vertex being a 3D vector (x, y, z). A triangle contains three indices (i0, i1, i2). Each index is used to index the vertex array to obtain the position of the triangle vertex.
[0102] 12) The cross-section is the visible surface after the mesh has been separated. Figure 1H This is a schematic diagram of a cross-section. Figure 1H The cross-section 151 in the middle was originally hidden in the sphere.
[0103] 13) Cross-sectional contour ring, which is the outer edge contour of the cross-section, consists of an index array. Figure 1I This is a schematic diagram of the outline ring of the cross section, where Figure 1I 161 in the figure represents the cross-sectional contour ring.
[0104] 14) A quadtree is a tree-like data structure where each node has four sub-blocks. Quadtrees are commonly used for the analysis and classification of two-dimensional spatial data. The data range can be square, rectangular, or any other arbitrary shape. All quadtree methods share a common characteristic: they can be decomposed into individual blocks, and each block has a node capacity. When a node reaches its maximum capacity, the node splits, and the tree-like data structure is differentiated according to the quadtree construction method.
[0105] This application provides a data processing method, apparatus, device, and computer-readable storage medium that can improve rendering efficiency. The exemplary application of the computer device provided in this application is described below. The computer device provided in this application can be implemented as various types of user terminals such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), or as a server. The exemplary application when the device is implemented as a server will be described below.
[0106] See Figure 2 , Figure 2Figure 1 is a schematic diagram of the architecture of a data processing system 100 provided in an embodiment of this application. As shown in Figure 1, the data processing system 100 includes a terminal 200, a network 300, and a server 400. The terminal 200 is designed to connect to the server 400 through the network 300, which can be a wide area network (WAN), a local area network (LAN), or a combination of both.
[0107] Terminal 200 can be a terminal used to design virtual scenes or virtual characters. After designers complete the design of virtual scenes and virtual characters through the design terminal, they obtain the corresponding 3D mesh data and send it to server 400. After receiving the 3D mesh data, server 400 first performs dimensionality reduction processing to obtain 2D mesh data. Then, it constructs a sub-mesh hierarchical structure based on the 2D mesh data and groups the triangles in the 2D mesh data to obtain multiple triangle group sets. In this embodiment, the cross-sectional rings of each triangle group set are also determined, and the cross-sections corresponding to the cross-sectional rings are pre-rendered. Server 400 also stores each sub-mesh and the corresponding triangle group set in a hierarchical manner according to the sub-mesh hierarchy. When it is necessary to render sub-meshes of different granularities, the corresponding hierarchical structure can be directly obtained. Furthermore, since the cross-sections of each triangle group set have been pre-rendered, no further calculation is required when decomposition rendering is needed; instead, the data can be directly displayed, thereby improving rendering efficiency.
[0108] In some embodiments, server 400 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminal 200 may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, smart in-vehicle device, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.
[0109] See Figure 3 , Figure 3 This is a schematic diagram of the structure of the server 400 provided in an embodiment of this application. Figure 3 The server 400 shown includes at least one processor 410, at least one network interface 420, a bus system 430, and memory 440. The various components in the server 400 are coupled together via the bus system 430. It is understood that the bus system 430 is used to implement communication between these components. In addition to a data bus, the bus system 430 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 3The general labeled all buses as Bus System 430.
[0110] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0111] The memory 440 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 440 may optionally include one or more storage devices physically located away from the processor 410.
[0112] The memory 440 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 440 described in this application embodiment is intended to include any suitable type of memory.
[0113] In some embodiments, memory 440 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0114] Operating system 441 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0115] The network communication module 442 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0116] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 3A data processing device 443 stored in memory 440 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: a dimensionality reduction module 4431, a hierarchical construction module 4432, a triangle grouping module 4433, a hierarchical storage module 4434, and a first determination module 4435. These modules are logically sequential and can therefore be arbitrarily combined or further split according to their implemented functions. The functions of each module will be described below.
[0117] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0118] The data processing method provided in this application will be described in conjunction with exemplary applications and implementations of the server provided in the embodiments of this application.
[0119] This application provides a data processing method, which can be implemented by a computer device, which can be a terminal or a server. In this application embodiment, the computer device is a server as an example for description. Figure 4 This is a schematic diagram of an implementation flow of the data processing method provided in the embodiments of this application. The following is in conjunction with... Figure 4 The steps shown illustrate the data processing method provided in the embodiments of this application.
[0120] Step S101: Obtain the three-dimensional mesh data to be processed, and perform dimensionality reduction processing on the three-dimensional mesh data to obtain two-dimensional mesh data.
[0121] Mesh data is a data structure that includes vertex data and face arrays. The difference between 3D and 2D mesh data is that in 3D mesh data, vertex positions are represented by a 3D spatial vector [x, y, z], while in 2D mesh data, vertex positions are represented by a 2D spatial vector [x, y]. Dimensionality reduction of 3D mesh data to obtain 2D mesh data is achieved by using a pre-defined mapping function to convert the 3D vertex position coordinates into 2D vertex position coordinates.
[0122] Two-dimensional mesh data includes vertex information and triangle information. Vertex information can be a vertex array, which includes multiple vertex indices and the vertex position vectors corresponding to each vertex index. Triangle information can be a triangle array (also called a face array), which includes the vertex indices of each triangle.
[0123] Step S102: Based on the two-dimensional grid data, construct a sub-grid hierarchical structure.
[0124] The subgrid structure at different levels includes a different number of subgrids. In implementation, the initial 2D grid data can be defined as the first-level subgrid. Then, the initial 2D grid data is divided to obtain multiple second-level subgrids. Each second-level subgrid is then further divided to obtain multiple third-level subgrids, and this process continues until the preset number of levels is reached, thus obtaining the subgrid hierarchical structure. Since each level of subgrid, except for the first-level subgrid, is obtained by dividing the subgrid of the previous level, the number of subgrids included in different levels of subgrid structure is different.
[0125] Step S103: Based on each subgrid, the two-dimensional grid data is triangularly grouped to obtain the triangular group set corresponding to each subgrid.
[0126] When implementing this step, the two-dimensional grid data can be triangularly grouped based on the region information of each sub-grid. The region information of the sub-grid can refer to the vertex coordinates of the smallest rectangular region that can surround the sub-grid, such as the vertex coordinates of the lower left vertex and the vertex coordinates of the upper right vertex of the rectangular region.
[0127] In implementation, the center coordinates of each triangle in the two-dimensional grid data are first determined, and then the triangle grouping set corresponding to each sub-grid in each level is determined according to the hierarchical order. In some embodiments, the triangles located in the rectangular area where the sub-grid is located can constitute the triangle grouping set corresponding to the sub-grid.
[0128] Step S104: Store each subgrid and the corresponding triangle group set in a hierarchical manner according to the subgrid hierarchy.
[0129] In other words, the first-level sub-mesh and its corresponding triangle group set are stored, the second-level sub-mesh and its corresponding triangle group set are stored separately, and so on. Since the sub-mesh is divided into different levels of granularity, and each sub-mesh and its corresponding triangle group set is stored hierarchically according to the sub-mesh level, when rendering sub-meshes of different granularities, the corresponding hierarchical structure can be directly retrieved, thereby improving rendering efficiency.
[0130] Step S105: Determine the cross-sectional ring of each sub-mesh based on vertex information and triangle information, and pre-render the cross-section of each sub-mesh based on the cross-sectional ring of each sub-mesh.
[0131] In this step, the connecting edges existing at the edges of the 2D mesh can be determined based on vertex and triangle information. Then, the cross-sectional rings of each sub-mesh are determined based on these edge-only connecting edges. That is, the cross-sectional rings include connecting edges (target edges) existing only in one triangle. Finally, based on the cross-sectional rings of each sub-mesh, the corresponding cross-sections are determined. The cross-sections are the visible surfaces separating the different meshes. These cross-sections are invisible during normal rendering of the virtual object corresponding to the 2D data; they are hidden internally. In this embodiment, the cross-sections of each sub-mesh are rendered in advance. This allows for direct display of the virtual object without decomposition calculations and rendering when decomposition is required, improving display efficiency.
[0132] In the data method provided in this application embodiment, after obtaining the three-dimensional mesh data to be processed, the three-dimensional mesh data is first subjected to dimensionality reduction processing to obtain two-dimensional mesh data. The two-dimensional mesh data includes vertex information and triangle information. Subsequent processing is then performed based on the two-dimensional mesh data, which can effectively reduce the amount of computation and improve computational efficiency. Then, based on the two-dimensional mesh data, a sub-mesh hierarchical structure is constructed, wherein each level of the sub-mesh structure includes at least one sub-mesh. Then, based on the region information of each sub-mesh, the triangles in the two-dimensional mesh data are grouped to obtain the triangle group set corresponding to each sub-mesh. The each sub-mesh and the triangle group set corresponding to each sub-mesh are then arranged according to the sub-mesh layer. The process involves layered storage. Finally, based on the vertex and triangle information, the cross-sectional rings of each sub-mesh are determined. Based on these cross-sectional rings, the cross-sections of each sub-mesh are pre-rendered. Since different levels of sub-mesh structures include different numbers of sub-mesh, meaning different levels of sub-mesh are divided into sub-mesh sections with different granularities, and each sub-mesh and its corresponding triangle group set are stored layered according to the sub-mesh hierarchy, the corresponding layered structure can be directly obtained when rendering sub-mesh of different granularities. Furthermore, since the cross-sections of each triangle group set have already been pre-rendered, no further calculation is required when decomposing the rendering; instead, the data can be directly displayed, thereby improving rendering efficiency.
[0133] In some embodiments, the step S101 above, "performing dimensionality reduction on the three-dimensional mesh data to obtain two-dimensional mesh data", can be achieved through the following steps S1011 to S1013, and each step is described below.
[0134] Step S1011: Obtain the preset conformal mapping function.
[0135] Conformal mapping is a branch of complex function theory that studies complex functions from a geometric perspective. It uses conformal mapping functions to map one region to another for study. This property allows irregular or mathematically difficult-to-express region boundaries to be mapped to regular or well-defined boundaries. In this embodiment, the predefined conformal mapping function can map three-dimensional space to two-dimensional space while maintaining angle invariance.
[0136] Step S1012: Obtain the three-dimensional coordinate information of each vertex from the three-dimensional mesh data.
[0137] In implementation, the corresponding three-dimensional coordinate information can be obtained based on the vertex index of each vertex, which represents the position of the vertex in three-dimensional space.
[0138] Step S1013: Use the conformal mapping function to perform conformal mapping on the three-dimensional coordinate information of each vertex to obtain the two-dimensional coordinate information of each vertex.
[0139] In implementing this step, the three-dimensional coordinate information of each vertex can be substituted into the conformal mapping function to obtain the two-dimensional coordinate information of each vertex.
[0140] Through the steps S1011 to S1013 described above, the dimensionality of the three-dimensional mesh data can be reduced to two-dimensional mesh data using the conformal mapping function. Subsequent processing based on the two-dimensional mesh data can effectively reduce the amount of computation and improve computational efficiency.
[0141] In some embodiments, the above-mentioned step S102, "constructing a sub-mesh hierarchical structure based on the two-dimensional mesh data," can be achieved by... Figure 5 Steps S1021 to S1025 are implemented as shown below, in conjunction with... Figure 5 Each step is explained.
[0142] Step S1021: Determine the grid corresponding to the two-dimensional grid data as the first-level sub-grid.
[0143] Step S1022: Obtain the vertex coordinates and center coordinates of the i-th target region corresponding to each i-th level sub-mesh.
[0144] In this embodiment, each sub-mesh of the i-th level corresponds to an i-th target region. In this step, the vertex coordinates and center coordinates of the i-th target region corresponding to each sub-mesh of the i-th level are obtained. i = 1, 2, ..., (N-1), where N is the preset number of levels and N is an integer greater than 1.
[0145] When i is 1, this step involves obtaining the vertex coordinates and center coordinates of the first target region corresponding to the first-level sub-grid. The first target region corresponding to the first-level sub-grid is the smallest rectangular region containing all triangles within the grid. The vertex coordinates of the first target region can be the coordinates of the bottom-left vertex and the top-right vertex, or the coordinates of all four vertices. The center coordinates can be determined based on the coordinates of the bottom-left vertex and the top-right vertex. Assuming the coordinates of the bottom-left vertex are (x1, y1) and the coordinates of the top-right vertex are (x2, y2), the center coordinates of the first target region are ((x1+x2) / 2, (y1+y2) / 2).
[0146] For example, when i is 2, there are 4 sub-grids in the second level. In this step, the vertex coordinates and center coordinates of the second target region corresponding to these 4 sub-grids are determined.
[0147] Step S1023: Divide each i-th level sub-grid based on the vertex coordinates and center coordinates of the i-th target region to obtain multiple (i+1)-th level sub-grids.
[0148] If i is 1, in this step, the first-level sub-mesh can be divided into two parts, for example, it can be divided based on the center coordinates along the length direction of the rectangle, or it can be divided based on the center coordinates along the width direction of the matrix; in some embodiments, the first-level sub-mesh can also be divided into four parts, for example, it can be divided based on the center coordinates along the length and width directions of the rectangle to obtain four second-level sub-mesh.
[0149] In this embodiment of the application, a subgrid identifier is also set for each level of subgrid. Assuming that each subgrid is further divided into 4 subgrids, the identifier of the first level subgrid can be 0, and the identifier of the second level subgrid can be 4*(the identifier of the parent grid of the previous level)+1, 4*(the identifier of the parent grid of the previous level)+2, 4*(the identifier of the parent grid of the previous level)+3 and 4*(the identifier of the parent grid of the previous level)+4. Then, the identifiers of the four second level subgrids are 1, 2, 3 and 4 respectively. The four third-level subgrids obtained by further subdividing the subgrid marked as 1 are marked as 5, 6, 7, and 8; the four third-level subgrids obtained by further subdividing the second-level subgrid marked as 2 are marked as 9, 10, 11, and 12, and so on. The four third-level subgrids obtained by further subdividing the second-level subgrid marked as 3 are marked as 13, 14, 15, and 16; and the four third-level subgrids obtained by further subdividing the second-level subgrid marked as 4 are marked as 17, 18, 19, and 20.
[0150] It should be noted that when dividing the i-th level subgrid to obtain the (1+1)-th level subgrid, each subgrid at the i-th level is divided, and each subgrid is further divided into the same number of subgrids. For example, the second-level subgrid is obtained by dividing the first-level subgrid into 4 parts, that is, the second-level subgrid includes 4 subgrids. When dividing the second-level subgrid to obtain the third-level subgrid, each of these 4 subgrids is further divided into 4 subgrids, so the third-level subgrid includes 16 subgrids. Through the above steps S1021 to S1025, the subgrid hierarchical structure is constructed, thus providing the necessary data foundation for subsequent triangle grouping.
[0151] In some embodiments, the above step S103, "grouping the two-dimensional grid data into triangles based on each sub-grid to obtain a set of triangle groups corresponding to each sub-grid," can be achieved through the following steps:
[0152] Step S1031: Determine the central coordinates of each triangle based on the vertex information and the triangle information.
[0153] When implementing this step, based on the vertex indices of each triangle, obtain the vertex coordinates of the triangle from the vertex information, and then determine the central coordinates of the triangle based on the three vertex coordinates of the triangle.
[0154] Step S1032: Obtain the vertex coordinates of the j-th sub-grid based on the region information of each sub-grid.
[0155] Where j = 1, 2, …, M, M is the total number of sub-grids and M is a positive integer. The region information of the sub-grid may refer to the vertex coordinates of the smallest rectangular region that can enclose the sub-grid. The vertex coordinates of the j-th sub-grid may be the vertex coordinates of two diagonals of the rectangular region corresponding to the j-th sub-grid. For example, they may be the coordinates of the lower left vertex and the upper right vertex, or the coordinates of the upper left vertex and the lower right vertex.
[0156] Step S1033: Based on the central coordinates of each triangle and the vertex coordinates of the j-th sub-grid, add the triangles whose central coordinates are located in the target region corresponding to the j-th sub-grid to the triangle grouping set corresponding to the j-th sub-grid.
[0157] When implementing this step, compare the central coordinates of each triangle with the vertex coordinates of the j-th sub-grid to determine whether the triangle is located in the target region corresponding to the j-th sub-grid. Assume that the coordinates of the lower left vertex of the target region corresponding to the j-th sub-grid are (x1, y1), and the coordinates of the upper right vertex are (x2, y2). The central coordinates of a certain triangle are (x c1 , y c1 ). Determine whether the triangle is located in the target region corresponding to the j-th sub-grid. When implementing, determine whether it satisfies x1 < x c1 < x2 and y1 < y c1 < y2. When x1 < x c1 < x2 and y1 < y c1 < y2 are satisfied, determine that the triangle is located in the target region corresponding to the j-th sub-grid, and add the triangle to the triangle grouping set corresponding to the j-th sub-grid; when x1 < x c1 < x2 and y1 < y c1 < y2 are not satisfied, determine that the triangle is not located in the target region corresponding to the j-th sub-grid, and at this time, determine whether the next triangle is in the target region corresponding to the j-th sub-grid.
[0158] Since the sub-mesh at different levels is obtained by dividing it according to different granularities, after dividing the sub-mesh, the triangle located in each sub-mesh can be determined based on the center coordinates of the triangle through the above steps S1031 to S1033. Then, when it is necessary to render some parts of the sub-mesh content, the data corresponding to these sub-mesh can be rendered directly, thereby improving the rendering efficiency.
[0159] In some embodiments, the above step S1031 "determine the center coordinates of each triangle based on the vertex information and the triangle information" can be implemented by the following steps S311 to S313, and each step is described below.
[0160] Step S311: Determine the coordinates of the three vertices of each triangle based on the vertex information and the triangle information.
[0161] In this step, the vertex index of each triangle can be obtained from the triangle array corresponding to the triangle information. Then, based on the vertex index of the triangle, the vertex coordinates corresponding to the vertex index are obtained from the vertex information. These vertex coordinates include the first vertex coordinate value and the second vertex coordinate value; that is, the vertex coordinates are a two-dimensional position vector. For example, the vertex coordinates of a certain vertex are (x... d1 y d1 ), where the coordinates of the first vertex are x d1 The coordinates of the second vertex are y d1 .
[0162] Step S312: Determine the first center coordinates of each triangle based on the coordinates of the three first vertices of each triangle.
[0163] In implementation, the coordinates of the three first vertices of the triangle can be taken as an arithmetic mean to obtain the coordinates of the first center of the triangle. For example, the coordinates of the three first vertices of the first triangle are x... d1 x d2 x d3 Then the coordinates of the first center of the triangle are (x, y). d1 +x d2 +x d3 ) / 3.
[0164] Step S313: Determine the second center coordinates of each triangle based on the coordinates of the three second vertices of each triangle.
[0165] Similar to step S312, this step can be implemented by taking the arithmetic mean of the coordinates of the three second vertices of the triangle to obtain the coordinates of the second center of the triangle. For example, the coordinates of the three first vertices of the first triangle are y = y + ... d1 yd2 y d3 Then the coordinates of the first center of the triangle are (y = y). d1 +y d2 +y d3 ) / 3.
[0166] Through the steps S311 to S313 described above, the center coordinates of each triangle can be calculated. In subsequent processes, the center coordinates of the triangles can be used to group the triangles, instead of using the coordinates of the three vertices. This can greatly reduce the amount of calculation and improve the calculation efficiency.
[0167] In some embodiments, step S105, "determining the cross-sectional ring of each sub-mesh based on the vertex information and the triangle information," can be achieved through the following steps:
[0168] Step S1051: Determine the target edge in each triangle group set based on the vertex information and the triangle information.
[0169] In this step, it can be implemented by determining the number of times the connecting edges included in each triangle group set are shared. This number of shared edges can characterize whether the connecting edge exists only in one triangle or exists in two triangles. Then, based on the number of shared edges, the target edge that exists only in one triangle can be determined.
[0170] Step S1052: Determine the target edges that are connected end to end and can form a closed loop from the multiple target edges in each triangle group set.
[0171] Step S1051 identifies the target edges in each triangle group. In some embodiments, target edges may also be called edge edges or open edges. In this step, based on the start and end points of each target edge, the target edges that are connected end to end and can form a closed loop can be determined. For example, suppose there are 6 target edges, namely edge 1 (A, B), edge 2 (B, C), edge 3 (C, D), edge 4 (D, A), edge 5 (E, F), and edge 6 (H, I). It can be found that the end points of edges 1, 2, 3, and 4 are the start points of adjacent edges, forming a closed loop. Therefore, edges 1, 2, 3, and 4 are target edges that are connected end to end and can form a closed loop.
[0172] Step S1053: The formed closed loops are determined as the cross-sectional loops of the respective sub-grids.
[0173] In this step, the closed loop obtained in step S1052 is determined as the cross-sectional ring of each sub-mesh. If the cross-section formed by the cross-sectional ring is a cross-section that is only displayed after the adjacent sub-mesh is separated, then this cross-section will not be displayed when all sub-mesh at a certain level is rendered. In some embodiments of this application, after determining the cross-sectional ring of each sub-mesh, the rendering is completed in advance. When it is necessary to decompose and display the virtual object, it can be displayed directly, thereby improving display efficiency.
[0174] In some embodiments, step S1051, "determining the target edge in each triangle grouping set based on the vertex information and the triangle information," includes:
[0175] Step S511: Determine each connecting edge in the k-th triangle grouping set based on the vertex information and the triangle information.
[0176] Here, k=1, 2, ..., M, where M is the total number of subgrids. In this step, we can obtain the vertex indices of each triangle in the k-th triangle group set, then determine the vertex coordinates based on the vertex indices, and determine the three connecting edges of the triangle based on the positional relationship between the vertex coordinates of the triangle.
[0177] For example, the coordinates of the three vertices OP and Q of a triangle are (x, y, q) and (x, y, q) respectively. o y o ), (x p y p ), (x q y q In this embodiment, it is assumed that the vertices of the triangle are connected in a clockwise direction. Therefore, the connection relationship of the three vertices can be determined based on their coordinates. Assuming the three vertices are in the clockwise order POQ, the three connecting edges of the triangle are PO, OQ, and QP. This step determines the connecting edges of each triangle in the triangle group set. For example, if the triangle group set contains 10 triangles, then the triangle group set includes 30 connecting edges.
[0178] Step S512: Determine the number of times each connecting edge is shared based on the triangle information.
[0179] In this step, the shared frequency of each connecting edge is first set to a first preset value. Then, it is sequentially determined whether there is a second connecting edge with the same vertex as the first connecting edge but in the opposite direction. When a second connecting edge with the same vertex as the first connecting edge but in the opposite direction exists among the other connecting edges besides the first connecting edge, the shared frequency of the first connecting edge is updated to the second preset value. Here, the first connecting edge can be any of the connecting edges. When a second connecting edge with the same vertex as the first connecting edge but in the opposite direction exists among the other connecting edges besides the first connecting edge, the shared frequency of the first connecting edge remains at the first preset value. For example, the first preset value can be 1, the second preset value can be 1, or the second preset value can be 0.
[0180] In other words, when a connecting edge exists in only one triangle, the number of times it is used is the first preset value; when a connecting edge exists in more than one triangle, the number of times it is used is the second preset value.
[0181] Step S513: The connecting edge with a common count of the first preset value is determined as the target edge in the k-th triangle group set.
[0182] Through steps S511 to S513 above, taking the triangle group set as a unit, the target edge that exists in only one triangle in each triangle group set is determined, thereby determining the cross-sectional ring of the sub-mesh corresponding to the triangle group set based on the determined target edge.
[0183] In some embodiments, such as Figure 6A As shown, after step S105, the rendering process can also be carried out through the following steps S106A to S108A. Each step is explained below.
[0184] Step S106A: Obtain the first target layer selected when rendering the virtual object corresponding to the two-dimensional mesh data.
[0185] When implementing this step, the technician can pre-set the first target level to be used when rendering the virtual object. For example, the technician can pre-set the second target level and set whether to render all or part of the sub-mesh of the second target level. If it is part of the sub-mesh, then the identifier of the sub-mesh to be rendered must be set.
[0186] Alternatively, the first target level to be used when rendering virtual objects can be determined based on the actual needs of the virtual scene. For example, if it is determined that the entire virtual object needs to be rendered based on the actual needs of the virtual scene, then the first target level is determined to be the first level. If it is determined that three-quarters of the virtual object needs to be rendered based on the actual needs of the virtual scene, then the first target level can be determined to be the second level.
[0187] Step S107A: Obtain at least one target sub-mesh to be rendered in the first target layer.
[0188] If the first target layer is pre-set by technicians, then the sub-mesh to be rendered in the first target layer will also be pre-set. In this case, the identifier of at least one target sub-mesh to be rendered can be obtained directly by retrieving the setting information. If the first target layer is determined based on the actual virtual scene requirements, then during implementation, the first target layer is determined based on whether all or part of the scene needs to be rendered, and the size of the rendered part. In other words, when the first target layer is determined, the part to be rendered is already determined, and thus the identifiers of the sub-mesh to be rendered can also be determined. For example, if it is determined that 3 / 4 of the virtual object needs to be rendered, and sub-mesh number 2 does not need to be rendered, then sub-meshes 1, 3, and 4 need to be rendered. Another example: if it is determined that 13 / 16 of the virtual object needs to be rendered, the first target layer is determined to be the third layer, and sub-meshes 8, 9, and 10 do not need to be rendered, then the other 13 sub-meshes can be determined to be rendered.
[0189] Step S108A: Render the at least one target sub-mesh to obtain a first rendering result.
[0190] In this step, the first rendering result is obtained by rendering based on multiple triangles in at least one target sub-mesh.
[0191] Since a sub-mesh hierarchical structure has been constructed in the aforementioned steps, and each level of sub-mesh has been divided into triangular groups, when rendering a part of the virtual object, the corresponding level and the sub-mesh to be rendered can be directly determined based on the size of the part to be rendered through the above steps S106A to S108A, thereby improving rendering efficiency.
[0192] In some embodiments, such as Figure 6B As shown, after step S105, decomposition rendering can also be performed through steps S106B to S109B as described below. Each step is explained below.
[0193] Step S106B: When it is determined that the virtual object rendered based on the two-dimensional mesh data meets the decomposition conditions, the second target level selected for rendering the virtual object is determined.
[0194] In implementation, when a virtual object collides with other virtual objects, the decomposition condition is determined. At this point, the second target level used for rendering the virtual object can be determined based on the collision intensity. For example, if the collision intensity is low, a small portion will decompose, so a higher-level second target level is selected, such as the third level, which includes 16 sub-mesh elements. In some embodiments, when a virtual object reaches a preset explosion timing, the decomposition condition is determined, and the second target level used for rendering the virtual object can be determined based on the preset explosion power.
[0195] Step S107B: Determine the movement and rotation information of each sub-grid in the second target level.
[0196] In this embodiment, each sub-mesh at each level also has preset movement and rotation information. This movement and rotation information is not acquired when decomposition rendering is not required; it is acquired only when the virtual object needs to be decomposed and rendered. The movement information represents the distance between the target rendering position and the current position, while the rotation information represents the rotation angle and direction between the target rendering orientation and the current rendering orientation.
[0197] Step S108B: Determine the rendering position of each sub-mesh based on the movement and rotation information of each sub-mesh.
[0198] When implementing this step, the initial position and initial orientation of each sub-mesh can be obtained. After obtaining the movement and rotation information of each sub-mesh, the rendering position of each sub-mesh can be determined using the movement information, initial position, initial orientation and rotation information of each sub-mesh.
[0199] Step S109B: Render each sub-mesh based on the rendering position to obtain a second rendering result.
[0200] The movement information between different sub-mesh units may be the same or different, and the rotation information between different sub-mesh units may be the same or different. When the movement and rotation information of two or more sub-mesh units are the same, it means that these two or more sub-mesh units are rendered as a whole. For example, let's take 16 sub-mesh units in the third level as an example. Suppose that during decomposition rendering, the rendering positions of sub-mesh units 8, 9, 10, and 15 are different from those of other sub-mesh units. The other 12 sub-mesh units, excluding 8, 9, 1, and 15, are rendered as a whole. Then, based on the rendering positions of each sub-mesh, the second rendering result is obtained. Figure 6C In the image, 501 is a virtual object rendered according to the original mesh, 502 is a virtual object rendered during the fragmentation process, and 503 is a virtual object rendered after the fragmentation is completed.
[0201] Through the above steps S106B to S109B, when the virtual object reaches the decomposition condition, the second target layer for rendering can be determined based on the pre-constructed sub-mesh layered structure, and the rendering position of each sub-mesh can be determined based on the movement and rotation information of each sub-mesh in the second target layer, thereby performing rendering, which can efficiently realize the decomposition rendering of the virtual object.
[0202] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0203] This application provides a method for representing a three-dimensional mesh hierarchical data structure. In implementation, the three-dimensional mesh is first converted into a two-dimensional mesh using a conformal map algorithm. Then, the two-dimensional mesh is grouped using a spatial hierarchical data structure, such as a Quad Tree or KD Tree. Finally, the vertex indices of triangles within the same group are stored in the same node. Furthermore, this method can also support sub-grouping.
[0204] Figure 6D This is a schematic diagram illustrating another implementation of the three-dimensional mesh hierarchical data structure representation method provided in the embodiments of this application. The following is in conjunction with... Figure 6D The implementation process of this method will be explained.
[0205] Step S601, dimensionality reduction.
[0206] Step S602: Calculate the center of the triangle.
[0207] Step S603: Construct the sub-mesh hierarchy.
[0208] Step S604: Group the main triangles.
[0209] Step S605, cross-section ring calculation.
[0210] The following explanation, with reference to the diagrams, details the implementation process of each step.
[0211] Figure 7 This is a schematic diagram illustrating the implementation process of the dimensionality reduction process provided in the embodiments of this application, as shown below. Figure 7 As shown, a 3D mesh can be reduced to a 2D mesh using the following steps:
[0212] Step S6011: Determine the conformal mapping function.
[0213] In this embodiment, the conformal mapping function can be represented by ConformMap(), which converts a 3D vector into 2D texture coordinates (uv). For each mesh vertex, the corresponding two-dimensional texture coordinates can be determined through the conformal mapping function.
[0214] Step S6012: Set the mesh vertex index ((meshVertIdx)) to 0.
[0215] Step S6013: Calculate texture coordinates from vertex positions using a conformal mapping function.
[0216] In implementation, vertex texture coordinates can be calculated using formula (1-1):
[0217] mesh.uv[meshVertIdx]=ConformMap(Meshvert[meshVertIDx]) (1-1);
[0218] Step S6014: Increment the grid vertex index by 1.
[0219] Step S6015: Determine whether the grid vertex index is less than the number of grid vertices.
[0220] If the grid vertex index is less than the number of grid vertices, proceed to step S6012; if the grid vertex index is not less than the number of grid vertices, it means that the dimensionality reduction process has been completed, and then proceed to step S602 to calculate the triangle center.
[0221] After reducing the dimensionality of each vertex in the grid and determining the index of each vertex, it can be done by... Figure 8 The steps shown determine the center coordinates of each triangle in the mesh. The following section combines... Figure 8 The process of determining the center of the triangle is explained.
[0222] Step S6021: Set the triangle index (triangleIDx) to 0.
[0223] Step S6022: Obtain the index and position of the first vertex of the triangle IDx-th triangle.
[0224] Where i0 = triangles[triangleIdx].indices[0], v0 = mesh.vert[i0].
[0225] Step S6023: Obtain the index and position of the second vertex of the triangle IDx-th triangle.
[0226] Where i1 = triangles[triangleIdx].indices[1], v1 = mesh.vert[i1].
[0227] Step S6024: Obtain the index and position of the third vertex of the triangle IDx-th triangle.
[0228] Among them, i2 = triangles[triangleIdx].indices[2], v2 = mesh.vert[i2].
[0229] Step S6025: Calculate the center of the triangle.
[0230] The center of the triangle can be calculated using triangle_center[TriangleIdx]=(v0+v1+v2) / 3.
[0231] Step S6026: Increment the triangle index triangleIDx by 1.
[0232] Step S6027: Determine whether the triangle index is less than the number of grid triangles.
[0233] If the triangle index is less than the number of grid triangles, it means that there are still grid triangles whose centers have not been calculated, and the process proceeds to step S6022; if the triangle index is not less than the number of grid triangles, it means that the calculation of the centers of all triangles in the grid has been completed, and the process proceeds to step S603.
[0234] Figure 9A This is a schematic diagram illustrating the implementation process of constructing a sub-mesh hierarchy provided in the embodiments of this application. The following is in conjunction with... Figure 9A The steps described illustrate the implementation process of constructing the sub-grid hierarchy.
[0235] Step S6031: Obtain the initial values of the maximum subnet level, the root subnet ID, and the vertex coordinates of the root subnet.
[0236] In this embodiment of the application, the maximum subnet level is 4, the initial value of the root subnet ID is 0, the initial value of the coordinates of the lower left corner of the root subnet is (0,0), and the initial value of the coordinates of the upper right corner vertex is (1,1).
[0237] Step S6032: Call the sub-mesh hierarchy construction function to complete the sub-mesh hierarchy construction.
[0238] The sub-mesh hierarchy construction function can be SubMesh(SubMeshLevel, SubMeshID, lowerLeft, upperRight). This step can be implemented using rootMesh=SubMesh(maxSubMeshLevel, rootSubMeshID, rootSubMeshLowerLeft, rootSubMeshUpperRight). Here, maxSubMeshLevel is the maximum sub-mesh level, rootSubMeshID is the root sub-mesh ID, rootSubMeshLowerLeft is the coordinate of the lower-left corner of the root sub-mesh, and rootSubMeshUpperRight is the coordinate of the upper-right corner of the root sub-mesh.
[0239] Figure 9B This is a schematic diagram illustrating the implementation logic of the sub-mesh hierarchy construction function provided in the embodiments of this application. The following is in conjunction with... Figure 9B The implementation logic of this function will be explained.
[0240] Step S321: Determine subMeshes[subMeshID] as the current submesh.
[0241] That is, currentSM = subMeshes[subMeshID].
[0242] Step S322: Set subMeshID to the current submesh ID, set the coordinates of the lower left corner of subMeshID to the coordinates of the lower left vertex of the current submesh, and set the coordinates of the upper right corner of subMeshID to the coordinates of the upper right vertex of the current submesh.
[0243] That is, currentSM.subMeshID=rootsubMeshID, currentSM.lowerLeft=rootSubMeshLowerLeft, currentSM.upperRight=rootSubMeshUpperRight.
[0244] Step S323: Determine whether the sub-grid level is non-zero.
[0245] When the sub-mesh level is non-zero, proceed to step S324; when the sub-mesh level is zero, proceed to step S329.
[0246] Step S324: Call SubMesh(SubMeshLevel-1, 4*SubMeshID+1, currentSM.GetSouthWest(), currentSM.GetCenter()) to determine the first submesh of the current submesh.
[0247] The `GetSouthWest()` function retrieves the southwest coordinates of the current subgrid, returning a position coordinate of (lowerLeft.x, lowerLeft.y). `GetCenter()` retrieves the center coordinates of the current subgrid, returning a position coordinate of ((lowerLeft.x + upperRight.x) * 0.5, (lowerLeft.y + upperRight.y) * 0.5). The ID of the first subgrid within the current subgrid is 4 * current subgrid ID + 1. The bottom-left corner of the first subgrid within the current subgrid represents its southwest coordinates, and the top-right corner represents its center coordinates.
[0248] Step S325: Call SubMesh(SubMeshLevel-1, 4*SubMeshID+2, currentSM.GetWest(), GetNorth()) to determine the second submesh of the current submesh.
[0249] The `GetWest()` function retrieves the western coordinates of the current subgrid, returning a position coordinate of (lowerLeft.x, (lowerLeft.y + upperRight.y) * 0.5). The `GetNorth()` function retrieves the northern coordinates of the current subgrid, returning a position coordinate of ((lowerLeft.x + upperRight.x) * 0.5, upperRight.y). The second subgrid ID of the current subgrid is 4 * current subgrid ID + 2. The lower-left corner of the second subgrid represents the western coordinates of the current subgrid, and the upper-right corner represents the northern coordinates.
[0250] Step S326: Call SubMesh(SubMeshLevel-1, 4*SubMeshID+3, currentSM.GetSouth(), GetEast()) to determine the third submesh of the current submesh.
[0251] The `GetSouth()` function retrieves the southern coordinates of the current subgrid, returning a position coordinate of ((lowerLeft.x + upperRight.x) * 0.5, lowerLeft.y). The `GetEast()` function retrieves the western coordinates of the current subgrid, returning a position coordinate of (lowerLeft.x, (lowerLeft.y + upperRight.y) * 0.5). The ID of the third subgrid within the current subgrid is 4 * current subgrid ID + 3. The lower-left corner of the third subgrid within the current subgrid represents its southern coordinates, and the upper-right corner represents its western coordinates.
[0252] Step S327: Call SubMesh(SubMeshLevel-1, 4*SubMeshID+4, currentSM.GetCenter(), GetNorthEast()) to determine the fourth submesh of the current submesh.
[0253] The `GetNorthEast()` function retrieves the northeast coordinates of the current subgrid. It returns a position coordinate (upperRight.x, upperRight.y). The fourth subgrid ID is 4 * current subgrid ID + 4. The bottom-left corner of the fourth subgrid is the center coordinate of the current subgrid, and the top-right corner is the northeast coordinate of the current subgrid.
[0254] Step S328: Return to the current sub-mesh.
[0255] Step S329: Set the first, second, third, and fourth subgrids of the current subgrid to empty.
[0256] Figure 9C This is a schematic diagram of the sub-mesh layered structure provided in the embodiments of this application, such as... Figure 9CAs shown, each SubMesh has its sub-Submesh. The root submesh is SubMesh0. SubMesh0 is divided into SubMesh1, SubMesh2, SubMesh3, and SubMesh4. SubMesh1 is further divided into SubMesh5, SubMesh6, SubMesh7, and SubMesh8. SubMesh5 is further divided into SubMesh21, SubMesh22, SubMesh23, and SubMesh24. In fact, SubMesh2, SubMesh3, and SubMesh4, as well as SubMesh6, SubMesh7, and SubMesh8, will continue to be subdivided into submeshes. Figure 9C Not shown in the image.
[0257] Figure 10A This is a schematic diagram illustrating the implementation process of the main triangle grouping provided in the embodiments of this application. The following is in conjunction with... Figure 10A The implementation process of grouping the main triangles is explained.
[0258] Step S6041: Set mesh.triangles to SourceTriangle and initialize the root sub-mesh ID to 0.
[0259] Step S6042: Use the AddTriangle function to assign a main triangle to each sub-mesh.
[0260] The AddTriangle function can be set to AddTriangle(subMeshID, triangles). When implementing this step, rootSubMeshID and SourceTriangle can be used as function parameters to complete the grouping of the main triangles.
[0261] Figure 10B This is a schematic diagram illustrating the implementation logic of the AddTriangle function provided in the embodiments of this application. The following is in conjunction with... Figure 10B The implementation logic of the AddTriangle function will be explained.
[0262] Step S421: Determine subMeshes[subMeshID] as the current submesh.
[0263] That is, currentSM = subMeshes[subMeshID].
[0264] Step S422: Initialize parameter i to 0.
[0265] Step S423: Obtain the center coordinates c of the i-th triangle.
[0266] Step S424, determine whether c.x >= currentSM.lowerLeft.x and c.x < currentSM.upperRight.x are satisfied.
[0267] Among them, if c.x >= currentSM.lowerLeft.x and c.x < currentSM.upperRight.x are satisfied, it means that the x coordinate of the center coordinate of the i-th triangle is within the x coordinate range of the current sub-grid. At this time, enter step S425; if c.x >= currentSM.lowerLeft.x and c.x < currentSM.upperRight.x are not satisfied, enter step S427.
[0268] Step S425, determine whether c.y >= currentSM.lowerLeft.y and c.y < currentSM.upperRight.y are satisfied.
[0269] Among them, if c.y >= currentSM.lowerLeft.y and c.y < currentSM.upperRight.y are satisfied, enter step S426; if c.y >= currentSM.lowerLeft.y and c.y < currentSM.upperRight.y are not satisfied, enter step S427.
[0270] Step S426, add the i-th triangle to the main triangle grouping corresponding to the current sub-grid.
[0271] Step S427, i = i + 1.
[0272] Step S428, determine whether i is less than the total number of triangles.
[0273] Among them, when i is less than the total number of triangles, enter step S423; when i is not less than the total number of triangles, it means that the grouping of the current sub-grid is completed. At this time, enter step S429.
[0274] Step S429, determine whether the first sub-grid divided from the current sub-grid is empty.
[0275] If the first sub-grid divided from the current sub-grid is not empty, enter step S4210; if the first sub-grid divided from the current sub-grid is empty, enter step S4211.
[0276] Step S4210: Call AddTriangle(4*subMeshID+1, triangles) to assign the main triangle to the first submesh divided by the current submesh.
[0277] Step S4211: Determine whether the second subgrid derived from the current subgrid is empty.
[0278] If the second subgrid derived from the current subgrid is not empty, proceed to step S4212; if the second subgrid derived from the current subgrid is empty, proceed to step S4213.
[0279] Step S4212: Call AddTriangle(4*subMeshID+2, triangles) to assign the main triangle to the second submesh divided by the current submesh.
[0280] Step S4213: Determine whether the third subgrid divided from the current subgrid is empty.
[0281] If the third subgrid derived from the current subgrid is not empty, proceed to step S4214; if the second subgrid derived from the current subgrid is empty, proceed to step S4215.
[0282] Step S4214: Call AddTriangle(4*subMeshID+3, triangles) to assign the main triangle to the third submesh divided by the current submesh.
[0283] Step S4215: Determine whether the fourth subgrid derived from the current subgrid is empty.
[0284] If the fourth subgrid derived from the current subgrid is not empty, proceed to step S4216; if the fourth subgrid derived from the current subgrid is empty, proceed to step S605.
[0285] Step S4216: Call AddTriangle(4*subMeshID+4, triangles) to assign the main triangle to the fourth submesh divided by the current submesh.
[0286] Through steps S421 to S4216, all triangles in the mesh (mesh.triangles) are processed by the function Adds Triangle. This function checks whether the center of each triangle is within the rectangular area of the sub-mesh. If a triangle is within the rectangular area of the sub-mesh, it is added to the main triangle set of that sub-mesh. After processing all triangles, it further determines whether each triangle is within a sub-mesh defined by the current sub-mesh. This recursive process continues until there are no more sub-meshes.
[0287] Figure 11A This is a schematic diagram of the implementation process of the calculation section ring provided in the embodiments of this application. The following is in conjunction with... Figure 11A The implementation process of the calculated cross-section ring is explained.
[0288] Step S6051: Initialize the root subgrid ID to 0.
[0289] Step S6052: Use the cross-section ring creation function to determine the cross-section ring of each sub-mesh.
[0290] The function for creating the cross-section ring can be BuildCrossSectionLoop(subMeshID). When implementing this step, the root sub-mesh ID can be determined as the parameter of the cross-section ring creation function. By recursively calling the function, the cross-section ring of each sub-mesh can be determined.
[0291] Figure 11B This is a schematic diagram illustrating the implementation logic of the section ring creation function provided in the embodiments of this application. The following is in conjunction with... Figure 11B The implementation logic is explained.
[0292] Step S521: Determine subMeshes[subMeshID] as the current submesh.
[0293] That is, currentSM=subMeshes[subMeshID], and when this function is called, subMeshID is the root submesh ID.
[0294] Step S522: Initialize the edge common count array to 0.
[0295] Step S523, set i=0.
[0296] Step S524: Obtain the i-th triangle in the main triangle set of the current sub-mesh.
[0297] Step S525, set j=0.
[0298] Step S526: Obtain the j-th edge of the i-th triangle.
[0299] Step S527: Obtain the reverse edge of the j-th edge.
[0300] In step S528, increment the number of times the j-th edge is shared by 1, and decrement the number of times the reverse edge of the j-th edge is shared by 1.
[0301] Step S529, j = j + 1.
[0302] Step S5210: Determine if j is less than 3.
[0303] If j is less than 3, proceed to step S526; if j is not less than 3, proceed to step S5211.
[0304] Step S5211, i = i + 1.
[0305] Step S5212: Determine whether i is less than the number of triangles in the main triangle set corresponding to the current subgrid.
[0306] If i is less than the number of triangles in the main triangle set corresponding to the current subgrid, proceed to step S524; if i is not less than the number of triangles in the main triangle set corresponding to the current subgrid, proceed to step S5213.
[0307] Step S5213, set k=0.
[0308] Step S5214: Determine whether the k-th element of the edge common count array is non-zero.
[0309] When the k-th element is non-zero, proceed to step S5215; when the k-th element is zero, proceed to step S5216.
[0310] Step S5215: Add the connection edge corresponding to the k-th element to the cross-sectional ring corresponding to the current sub-mesh.
[0311] Step S5216, k = k + 1.
[0312] Step S5217: Determine whether k is less than the total number of edges corresponding to the current sub-grid.
[0313] If k is less than the total number of edges corresponding to the current sub-grid, proceed to step S5214; if k is not less than the total number of edges corresponding to the current sub-grid, proceed to step S5218.
[0314] Step S5218: Determine whether the first subgrid divided by the current subgrid is empty.
[0315] If the first sub-grid derived from the current sub-grid is not empty, proceed to step S5219; if the first sub-grid derived from the current sub-grid is empty, proceed to step S5220.
[0316] Step S5219: Call BuildCrossSectionLoop(4*subMeshID+1) to determine the cross-sectional loop of the first sub-mesh divided by the current sub-mesh.
[0317] Step S5220: Determine whether the second subgrid derived from the current subgrid is empty.
[0318] If the second subgrid derived from the current subgrid is not empty, proceed to step S5221; if the second subgrid derived from the current subgrid is empty, proceed to step S5222.
[0319] Step S5221: Call BuildCrossSectionLoop(4*subMeshID+2) to determine the cross-sectional loop of the second sub-mesh divided from the current sub-mesh.
[0320] Step S5222: Determine whether the third subgrid divided from the current subgrid is empty.
[0321] If the third subgrid derived from the current subgrid is not empty, proceed to step S5223; if the second subgrid derived from the current subgrid is empty, proceed to step S5224.
[0322] Step S5223: Call BuildCrossSectionLoop(4*subMeshID+3) to determine the cross-sectional loop of the third submesh divided from the current submesh.
[0323] Step S5224: Determine whether the fourth subgrid divided from the current subgrid is empty.
[0324] If the fourth subgrid derived from the current subgrid is not empty, proceed to step S5225; if the fourth subgrid derived from the current subgrid is empty, end the process.
[0325] Step S5225: Call BuildCrossSectionLoop(4*subMeshID+4) to determine the cross-sectional loop of the fourth submesh divided from the current submesh.
[0326] The data processing method provided in this application reduces the dimensionality of three-dimensional mesh data to two-dimensional mesh data, thereby enabling the grouping problem to be processed in a low-dimensional (two-dimensional) space instead of using a high-dimensional (three-dimensional) octree. This reduces computational complexity. After dimensionality reduction, the coordinates of each triangle in the two-dimensional mesh data are calculated, and a sub-mesh hierarchical structure is constructed. Subsequently, a set of main triangles is assigned to each sub-mesh, thereby supporting multiple "multi-level explosion" effects. The cross-sectional rings of each sub-mesh are determined and cached, improving rendering efficiency and enabling real-time rendering.
[0327] The following description continues to illustrate the exemplary structure of the data processing device 443 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 3 As shown, the software modules stored in the data processing device 443 of the memory 440 may include:
[0328] The dimension reduction module 4431 is used to acquire the three-dimensional mesh data to be processed, and to perform dimension reduction processing on the three-dimensional mesh data to obtain two-dimensional mesh data, wherein the two-dimensional mesh data includes vertex information and triangle information.
[0329] The hierarchical construction module 4432 is used to construct a sub-mesh hierarchical structure based on the two-dimensional mesh data, wherein each level of the sub-mesh structure includes at least one sub-mesh;
[0330] The triangle grouping module 4433 is used to perform triangle grouping on the two-dimensional grid data based on each sub-grid to obtain a set of triangle groups corresponding to each sub-grid.
[0331] The hierarchical storage module 4434 is used to store each sub-grid and the triangle group set corresponding to each sub-grid in a hierarchical manner according to the sub-grid hierarchy.
[0332] The first determining module 4435 is used to determine the cross-sectional ring of each sub-mesh based on the vertex information and the triangle information, and to pre-render the cross-section of each sub-mesh based on the cross-sectional ring of each sub-mesh.
[0333] In some embodiments, the dimensionality reduction module 4431 is further configured to:
[0334] Obtain the preset conformal mapping function;
[0335] Obtain the three-dimensional coordinate information of each vertex from the three-dimensional mesh data;
[0336] The three-dimensional coordinate information of each vertex is conformally mapped using the conformal mapping function to obtain the two-dimensional coordinate information of each vertex.
[0337] In some embodiments, the hierarchical building module 4432 is further configured to:
[0338] The grid corresponding to the two-dimensional grid data is determined as the first-level sub-grid;
[0339] Obtain the vertex coordinates and center coordinates of the target region corresponding to each sub-grid of the i-th level, i=1,2,...,(N-1), where N is the preset number of levels and N is an integer greater than 1;
[0340] Based on the vertex coordinates and center coordinates of the i-th target region, the i-th level sub-grids are divided to obtain multiple (i+1)-th level sub-grids.
[0341] In some embodiments, the triangle grouping module 4433 is further configured to:
[0342] The center coordinates of each triangle are determined based on the vertex information and the triangle information.
[0343] The vertex coordinates of the j-th subgrid are obtained based on the region information of each subgrid, where j = 1, 2, ..., M, M is the total number of subgrids, and M is a positive integer;
[0344] Based on the center coordinates of each triangle and the vertex coordinates of the j-th subgrid, the triangles whose center coordinates are located in the target region corresponding to the j-th subgrid are added to the triangle grouping set corresponding to the j-th subgrid.
[0345] In some embodiments, the triangle grouping module 4433 is further configured to:
[0346] Based on the vertex information and the triangle information, the coordinates of the three vertices of each triangle are determined, wherein the vertex coordinates include the coordinate values of the first vertex and the second vertex.
[0347] The first center coordinates of each triangle are determined based on the coordinates of the three first vertices of each triangle.
[0348] The second center coordinates of each triangle are determined based on the coordinates of the three second vertices of each triangle.
[0349] In some embodiments, the first determining module 4435 is further configured to:
[0350] Based on the vertex information and the triangle information, the target edge in each triangle group set is determined, and the target edge is the edge that exists in only one triangle;
[0351] From the multiple target edges in each of the triangle group sets, determine the target edges that are connected end to end and can form a closed loop;
[0352] Each closed loop is defined as a cross-sectional loop of each sub-grid.
[0353] In some embodiments, the first determining module 4435 is further configured to:
[0354] Based on the vertex information and the triangle information, determine each connecting edge in the k-th triangle group set, k=1,2,...,M, where M is the total number of sub-grids and M is a positive integer;
[0355] The number of times each connecting edge is shared is determined based on the triangle information;
[0356] The connecting edge with a common frequency of the first preset value is determined as the target edge in the k-th triangle set.
[0357] In some embodiments, the first determining module 4435 is further configured to:
[0358] Set the number of times each of the connected edges is used together to a first preset value;
[0359] When there is a second connecting edge among the other connecting edges besides the first connecting edge that has the same vertex as the first connecting edge but in the opposite direction, the number of times the first connecting edge is used is updated to a second preset value; wherein, the first connecting edge is any one of the connecting edges.
[0360] In some embodiments, the device further includes:
[0361] The first acquisition module is used to acquire the first target level selected when rendering the virtual object corresponding to the two-dimensional grid data;
[0362] The second acquisition module is used to acquire at least one target sub-mesh to be rendered in the first target level;
[0363] The first rendering module is used to render the at least one target sub-mesh to obtain a first rendering result.
[0364] In some embodiments, the device further includes:
[0365] The second determining module is used to determine the second target level to be used when rendering the virtual object when it is determined that the virtual object rendered based on the two-dimensional grid data has reached the decomposition condition.
[0366] The third determining module is used to determine the movement and rotation information of each sub-grid in the second target level;
[0367] The fourth determining module is used to determine the rendering position of each sub-mesh based on the movement and rotation information of each sub-mesh;
[0368] The second rendering module is used to render each sub-mesh based on the rendering position to obtain a second rendering result.
[0369] It should be noted that the description of the data processing apparatus in this application is similar to the description of the method embodiments described above, and has similar beneficial effects. For technical details not disclosed in this apparatus embodiment, please refer to the description of the method embodiments of this application for understanding.
[0370] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data processing method described in this application.
[0371] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to perform the data processing method provided in this application, for example... Figure 4 , Figure 5 , Figure 6A , Figure 6B Figure 6C The data processing method is shown.
[0372] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0373] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0374] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0375] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0376] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A data processing method, characterized in that, The method includes: Acquire the three-dimensional mesh data of the virtual object to be processed, and perform dimensionality reduction processing on the three-dimensional mesh data to obtain two-dimensional mesh data, wherein the two-dimensional mesh data includes vertex information and triangle information; The grid corresponding to the two-dimensional grid data is determined as the first-level sub-grid; the vertex coordinates and center coordinates of the i-th target region corresponding to each i-th level sub-grid are obtained, i=1,2,...,N-1, N is the preset number of levels, and N is an integer greater than 1; the i-th level sub-grids are divided based on the vertex coordinates and center coordinates of the i-th target region to obtain multiple (i+1)-th level sub-grids, wherein each level of sub-grid structure includes at least one sub-grid; Based on each subgrid, the two-dimensional grid data is triangularly grouped to obtain the triangular group set corresponding to each subgrid; Each subgrid and the corresponding triangle group set are stored hierarchically according to the subgrid hierarchy. Based on the vertex information and the triangle information, the target edge in each triangle group set is determined, and the target edge is the edge that exists in only one triangle; From the multiple target edges in each of the triangle group sets, determine the target edges that are connected end to end and can form a closed loop; Each closed loop is defined as a cross-sectional loop of each sub-mesh, and the cross-section of each sub-mesh is determined based on the cross-sectional loop of each sub-mesh. The cross-section of each sub-mesh is rendered in advance.
2. The method according to claim 1, characterized in that, The dimensionality reduction process for the three-dimensional mesh data to obtain two-dimensional mesh data includes: Obtain the preset conformal mapping function; Obtain the three-dimensional coordinate information of each vertex from the three-dimensional mesh data; The three-dimensional coordinate information of each vertex is conformally mapped using the conformal mapping function to obtain the two-dimensional coordinate information of each vertex.
3. The method according to claim 1, characterized in that, The step of triangularly grouping the two-dimensional grid data based on each sub-grid to obtain a set of triangular groups corresponding to each sub-grid includes: The center coordinates of each triangle are determined based on the vertex information and the triangle information. The vertex coordinates of the j-th subgrid are obtained based on the region information of each subgrid, where j = 1, 2, ..., M, M is the total number of subgrids, and M is a positive integer; Based on the center coordinates of each triangle and the vertex coordinates of the j-th subgrid, the triangles whose center coordinates are located in the target region corresponding to the j-th subgrid are added to the triangle grouping set corresponding to the j-th subgrid.
4. The method according to claim 3, characterized in that, Determining the center coordinates of each triangle based on the vertex information and the triangle information includes: Based on the vertex information and the triangle information, the coordinates of the three vertices of each triangle are determined, wherein the vertex coordinates include the coordinate values of the first vertex and the second vertex. The first center coordinates of each triangle are determined based on the coordinates of the three first vertices of each triangle. The second center coordinates of each triangle are determined based on the coordinates of the three second vertices of each triangle.
5. The method according to claim 1, characterized in that, The step of determining the target edge in each triangle grouping set based on the vertex information and the triangle information includes: Based on the vertex information and the triangle information, determine each connecting edge in the k-th triangle group set, k=1,2,...,M, where M is the total number of sub-grids and M is a positive integer; The number of times each connecting edge is shared is determined based on the triangle information; The connecting edge with the first preset number of times is determined as the target edge in the k-th triangle group set.
6. The method according to claim 5, characterized in that, Determining the number of times each connecting edge is shared based on the triangle information includes: Set the number of times each of the connected edges is used together to a first preset value; When there is a second connecting edge among the other connecting edges besides the first connecting edge that has the same vertex as the first connecting edge but in the opposite direction, the number of times the first connecting edge is used is updated to a second preset value; wherein, the first connecting edge is any one of the connecting edges.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: The first target layer selected when obtaining and rendering the virtual object corresponding to the two-dimensional mesh data; Obtain at least one target sub-mesh to be rendered in the first target level; The at least one target sub-mesh is rendered to obtain a first rendering result.
8. The method according to any one of claims 1 to 6, characterized in that, The method further includes: When it is determined that the virtual object rendered based on the two-dimensional mesh data meets the decomposition conditions, the second target level selected for rendering the virtual object is determined. Determine the movement and rotation information of each sub-grid in the second target level; The rendering position of each sub-mesh is determined based on the movement and rotation information of each sub-mesh; The second rendering result is obtained by rendering each sub-mesh based on the rendering position.
9. A data processing apparatus, characterized in that, The device includes: The dimensionality reduction module is used to acquire the three-dimensional mesh data of the virtual object to be processed, and to perform dimensionality reduction processing on the three-dimensional mesh data to obtain two-dimensional mesh data, wherein the two-dimensional mesh data includes vertex information and triangle information. A hierarchical construction module is used to determine the grid corresponding to the two-dimensional grid data as the first-level sub-grid; obtain the vertex coordinates and center coordinates of the i-th target region corresponding to each i-th level sub-grid, i=1,2,...,N-1, N is the preset number of levels, and N is an integer greater than 1; divide each i-th level sub-grid based on the vertex coordinates and center coordinates of the i-th target region to obtain multiple i+1-th level sub-grids, wherein each level of sub-grid structure includes at least one sub-grid; The triangle grouping module is used to perform triangle grouping on the two-dimensional grid data based on each sub-grid to obtain a set of triangle groups corresponding to each sub-grid. The hierarchical storage module is used to store each sub-grid and the corresponding triangle group set according to the sub-grid hierarchy. The first determining module is used to determine the target edges in each triangle group set based on the vertex information and the triangle information, wherein the target edge is an edge that exists only in one triangle; determine the target edges that are connected end to end and can form a closed loop from the multiple target edges in each triangle group set; determine each closed loop as the cross-sectional ring of each sub-mesh, and determine the cross-section of each sub-mesh based on the cross-sectional ring of each sub-mesh, and pre-render the cross-section of each sub-mesh.
10. A computer device, characterized in that, The computer device includes: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the data processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium storing executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the data processing method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the data processing method according to any one of claims 1 to 8.