Three-dimensional grid rendering method and device, equipment and storage medium
By analyzing the three-dimensional grid files and multi-threading, combining with user editing status, a three-dimensional grid that meets actual needs is generated, which solves the problem of low rendering quality in the existing technology and realizes efficient three-dimensional grid rendering.
Patent Information
- Application Number
- CN202510684142.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, C/S client professional grid processing software is difficult to combine with three-dimensional data in digital twin water conservancy construction, and general geographic information platform software cannot efficiently process massive three-dimensional grid data, resulting in the three-dimensional grid rendering quality that does not meet actual needs.
By analyzing the three-dimensional grid file, an initial grid basic information array is generated, and multi-threaded decompression is used. Combined with the grid editing status selected by the user, the target rendering mode is determined, and the rendering process is performed according to the preset rendering process, including rendering and editing operations of grid vertices, edges, and faces.
High-quality three-dimensional grid rendering is realized, adapting to the needs of different simulation scenarios, improving rendering quality and efficiency, and solving the problem that the rendering quality in the existing technology does not meet the actual needs.
Smart Images

Figure CN120472098A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a three-dimensional grid rendering method, apparatus, device and storage medium. Background Art
[0002] Digital twin water conservancy is a key implementation path for promoting high-quality development of water conservancy in the new era. Digital twin water conservancy systems require accurate hydrodynamic models to simulate flow and water level fluctuations. The quality and accuracy of 3D meshes, the foundational framework of these models, directly impact the simulation results. Therefore, to meet the demands of digital twin water conservancy construction and generate high-quality mesh data, 3D mesh rendering and editing are necessary.
[0003] In the existing technology, the grid is usually rendered using client-side professional grid processing software or general geographic information platform software with a client / server (C / S) structure. Since the C / S client-side professional grid processing software has limited support capabilities for geographic information spatial data, it is difficult to combine it with the three-dimensional data base in digital twin water conservancy construction. The general geographic information platform software cannot perform high-performance online editing of massive three-dimensional grid data, which results in the three-dimensional grid generated using existing technology not meeting actual needs and reducing the rendering quality of the grid. Summary of the Invention
[0004] Based on the above problems, the present application provides a three-dimensional grid rendering method, device, equipment and storage medium, the purpose of which is to generate a three-dimensional grid that meets actual needs, thereby improving the accuracy of the hydrodynamic model.
[0005] The embodiments of this application disclose the following technical solutions:
[0006] In a first aspect, the present application provides a three-dimensional mesh rendering method, comprising:
[0007] Parsing the acquired three-dimensional mesh file to determine an initial mesh basic information array; a set of initial mesh basic information arrays is used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension, and vertex attribute dimension respectively;
[0008] Decompressing the initial grid basic information array using multiple threads to obtain a target grid basic information array;
[0009] In response to a user-selected mesh editing state, determining a target mesh rendering mode;
[0010] The target grid basic information array is rendered according to the preset target grid rendering process corresponding to the target grid rendering mode.
[0011] Optionally, in the above method, the step of parsing the acquired three-dimensional grid file to determine the initial grid basic information array includes:
[0012] Extracting three-dimensional grid information from a three-dimensional grid file; the three-dimensional grid information includes grid points, grid topology relationships, and grid properties of the three-dimensional grid;
[0013] Based on a preset grid basic information array structure, converting the three-dimensional grid information to obtain a grid basic information array;
[0014] The grid basic information array is subjected to binary conversion and compression processing to obtain an initial grid basic information array.
[0015] Optionally, in the method described above, the mesh basic information array of the three-dimensional mesh includes a mesh vertex index array, a mesh vertex attribute array, a mesh face index array, and a mesh edge index array; the mesh vertex index array is used to store the vertex index of each mesh vertex in the three-dimensional mesh; the mesh vertex attribute array is used to store the vertex attribute of each mesh vertex in the three-dimensional mesh; the mesh edge index array is used to store the vertex index corresponding to each mesh edge in the three-dimensional mesh, and the mesh face index array is used to store the vertex indices corresponding to the vertex components of the three-dimensional mesh.
[0016] Optionally, in the above method, if the mesh editing state is the editing state, determining the target mesh rendering mode in response to the mesh editing state selected by the user includes:
[0017] In response to the user selecting the mesh editing state as the editing state, determining the target mesh rendering mode as a mesh face rendering mode, an editable mesh vertex rendering mode, or an editable mesh edge rendering mode;
[0018] The rendering process of the target grid basic information array is performed according to the preset target grid rendering process corresponding to the target grid rendering mode, including:
[0019] Obtaining position information and attribute information of mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array;
[0020] In the editable mesh vertex rendering mode, in response to an event interaction operation of a first target mesh vertex selected by a user, performing editing processing and rendering processing on the first target mesh vertex;
[0021] In the editable mesh edge rendering mode, based on the mesh vertex index array and the mesh vertex attribute array, in response to an event interaction operation of the user on the at least two second target mesh vertices selected, performing editing processing and rendering processing on the mesh edges corresponding to the at least two second target mesh vertices;
[0022] In the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the correspondence between preset attribute values and colors; the attribute values are the values corresponding to the mesh vertices in the mesh vertex attribute array under the preset vertex attributes.
[0023] Optionally, in the above method, if the mesh editing state is a non-editing state, determining a target mesh rendering mode in response to the mesh editing state selected by the user includes:
[0024] In response to the mesh editing state selected by the user being a non-editing state, determining the target mesh rendering mode to be a mesh edge rendering mode and a mesh face rendering mode;
[0025] The rendering process of the target grid basic information array is performed according to the preset target grid rendering process corresponding to the target grid rendering mode, including:
[0026] Obtaining position information and attribute information of mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array;
[0027] In mesh edge rendering mode, index information of mesh edges is read from the mesh edge index array, and based on the position information and attribute information of the mesh vertices, the mesh edges of the three-dimensional mesh are treated as spatial objects, and the mesh edges are rendered by primitive drawing;
[0028] In the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the preset corresponding relationship between the attribute value and the color.
[0029] Optionally, in the method described above, when the mesh editing state selected by the user is the editing state, the mesh editing state also includes a mesh vertex threshold editing state, which is used to control whether the three-dimensional mesh is split in the editing state so that the local mesh in the three-dimensional mesh can be rendered.
[0030] Optionally, the method as described above further includes:
[0031] When it is determined that the number of mesh vertices in the editing range is greater than a preset mesh vertex threshold and the number of mesh vertices is less than the total number of mesh vertices of the plurality of three-dimensional meshes, splitting the target three-dimensional mesh within the editing range and extracting a local mesh basic information array corresponding to the target three-dimensional mesh from the target mesh basic information array; the editing range is the mesh range displayed by the user through zooming;
[0032] Constructing an initial index mapping relationship between the local grid basic information array and the target grid basic information array corresponding to the target three-dimensional grid;
[0033] In response to the user's event interaction operation on the target three-dimensional grid, the initial index mapping relationship is updated to obtain a target index mapping relationship, and according to the target index mapping relationship, the target grid basic information array of the target three-dimensional grid is updated to re-render the target three-dimensional grid.
[0034] In a second aspect, the present application provides a three-dimensional mesh rendering device, comprising:
[0035] A file parsing module is used to parse the acquired three-dimensional mesh file and determine an initial mesh basic information array; a set of initial mesh basic information arrays is used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension respectively;
[0036] A data decompression processing module is used to decompress the initial grid basic information array using multiple threads to obtain a target grid basic information array;
[0037] a rendering mode determination module, configured to determine a target mesh rendering mode in response to a mesh editing state selected by a user;
[0038] The three-dimensional mesh rendering module is used to render the target mesh basic information array according to the preset target mesh rendering process corresponding to the target mesh rendering mode.
[0039] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0040] Memory stores computer-executable instructions;
[0041] The processor executes the computer-executable instructions stored in the memory to implement the three-dimensional mesh rendering method described in any one of the above embodiments.
[0042] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the three-dimensional mesh rendering method described in any of the above embodiments.
[0043] Compared with the existing technology, this application has the following beneficial effects:
[0044] The acquired three-dimensional mesh file is parsed and processed to determine an initial mesh basic information array; a group of initial mesh basic information arrays are used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension respectively, which can fully and accurately describe the three-dimensional mesh; then the initial mesh basic information array is decompressed by multi-threading to improve data processing capabilities to process large-scale three-dimensional mesh data and obtain a target mesh basic information array; in response to the mesh editing state selected by the user, a target mesh rendering mode is determined; according to the preset target mesh rendering process corresponding to the target mesh rendering mode, the target mesh basic information array is rendered and processed, which can adapt to different simulation scenarios and needs, generate a three-dimensional mesh that meets actual needs, and improve mesh rendering quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A schematic diagram of a flow chart of a three-dimensional mesh rendering method provided in an embodiment of the present application;
[0047] Figure 2 A schematic structural diagram of a three-dimensional grid rendering device provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] To make the objectives, technical solutions, and advantages of this application more clearly understood, the application is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be noted that the embodiments described in the embodiments of this application are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0050] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by people with ordinary skills in the field to which this application belongs. The words "first", "second" and similar terms used in the embodiments of this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "include" or "comprise" mean that the elements or objects preceding the word include the elements or objects listed after the word and their equivalents, but do not exclude other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0051] As previously described, current grid editing tools primarily include client-side professional grid processing software and general-purpose geographic information platform software. C / S client-side professional grid processing software generally suffers from several issues: First, it is generally based on a two-dimensional map engine, with limited support for a wide variety of geographic information spatial data. This makes it difficult to effectively integrate with the three-dimensional data bases such as terrain, oblique photography, and BIM, as well as the numerous water conservancy elements generated during digital twin water conservancy construction, and it cannot support the rendering and editing of three-dimensional grid data. Second, software installation consumes significant resources, and its interface is complex and specialized, making it unfriendly to Chinese users. Third, due to operating system limitations, it is unable or insufficient to support cross-platform or purely domestic use. General-purpose geographic information platform software generally lacks high-performance online editing capabilities for massive amounts of three-dimensional grid data, and faces performance bottlenecks in rendering and processing irregular grid data in the millions or even tens of millions of data points.
[0052] After research, the inventors have proposed a three-dimensional mesh rendering method, device, equipment and storage medium, which can generate rendering results of three-dimensional meshes that meet actual needs and improve the rendering quality of the mesh.
[0053] In order to help those skilled in the art better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0054] See also Figure 1 , which is a flow chart of a three-dimensional grid rendering method provided by an embodiment of the present application. Figure 1As shown, the method includes:
[0055] S101: Analyze the acquired three-dimensional grid file to determine an initial grid basic information array.
[0056] Among them, a set of initial mesh basic information arrays is used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension respectively.
[0057] In this embodiment, WebGL technology is used to read the three-dimensional mesh spatial data in the three-dimensional mesh file to parse and extract the vertex coordinates, mesh edge index, mesh face index, vertex attributes and other information required for three-dimensional mesh rendering, and create a mesh basic information array. The mesh basic information array is then binary converted and compressed to obtain an initial mesh basic information array. By streamlining the mesh data structure, the complexity of WebGL front-end construction or data processing can be reduced.
[0058] The following describes an example implementation method for parsing an acquired 3D mesh file to determine an initial mesh basic information array. The implementation method includes the following steps:
[0059] S1011: Extracting three-dimensional mesh information from the three-dimensional mesh file.
[0060] The three-dimensional grid information includes the grid points, grid topology and grid properties of the three-dimensional grid.
[0061] In this embodiment, the grid points of the three-dimensional grid are the basic building blocks of the three-dimensional grid, and their coordinate information directly determines the geometric shape of the grid; the grid topology describes the connection relationship between grid points, edges, and faces; and the grid attributes may include but are not limited to vertex height, vertex identifier, etc.
[0062] S1012: Based on a preset grid basic information array structure, convert the three-dimensional grid information to obtain a grid basic information array.
[0063] In one possible implementation, the mesh basic information array of the three-dimensional mesh includes a mesh vertex index array, a mesh vertex attribute array, a mesh face index array, and a mesh edge index array; the mesh vertex index array is used to store the vertex index of each mesh vertex in the three-dimensional mesh; the mesh vertex attribute array is used to store the vertex attribute of each mesh vertex in the three-dimensional mesh; the mesh edge index array is used to store the vertex index corresponding to each mesh edge in the three-dimensional mesh, and the mesh face index array is used to store the vertex indices corresponding to the vertices that make up the three-dimensional mesh.
[0064] In this embodiment, a mesh is represented by a group of four vertex indices. A group of equal vertex indices represents a triangular mesh, while a group of unequal vertex indices represents a quadrilateral mesh. For example, if a triangular mesh has only three vertices and the vertex indices are 0, 1, and 2, the four vertex indices 0, 1, 2, and 0 represent the triangular mesh. If a mesh consists of five vertices and the vertex indices are 0, 1, 2, 3, and 4, the mesh is a hybrid mesh consisting of a triangular mesh [0, 1, 2] and a quadrilateral mesh [1, 2, 3, 4].
[0065] Based on the preset grid basic information array structure, the three-dimensional grid information is converted and processed to obtain the grid basic information array. Taking a triangular grid as an example, the triangular grid consists of three vertices, and the vertex indexes are 0, 1, and 2 respectively. If the vertex coordinates corresponding to index 0 are (x0, y0), the vertex coordinates corresponding to index 1 are (x1, y1), and the vertex coordinates corresponding to index 2 are (x2, y2), then the grid vertex index array of the grid is [(x0, y0), (x1, y1), (x2, y2)]; the grid edge index array can be expressed as [0, 1, 2, 0]; the grid face index array can be expressed as [(0, 1), (1, 2), (2, 0)]; if the three vertices of the grid have two attribute fields, namely id and height, then the grid vertex attribute array is [2, id, height] ght, 0, 10, 1, 5, 2, 6], the data in the mesh vertex attribute array can be split into multiple arrays [[2], [id, height], [0, 10], [1, 5], [2, 6]]; among them, the first array [2] indicates that there are 2 vertex attributes, and the id and height in the second array [id, height] represent the attribute fields, id represents the vertex identifier, height represents the vertex height, the elements in [0, 10] represent the vertex identifier and vertex height corresponding to index 0, the elements in [1, 5] represent the vertex identifier and vertex height corresponding to index 1, and the elements in [2, 6] represent the vertex identifier and vertex height corresponding to index 2. Taking a quadrilateral mesh as an example, the quadrilateral mesh consists of four vertices, and the vertex indices are 0, 1, 2, and 3 respectively, then the mesh edge index array can be represented as [0, 1, 2, 3].
[0066] S1013: Perform binary conversion and compression processing on the grid basic information array to obtain an initial grid basic information array.
[0067] In this embodiment, the grid basic information array of the generated three-dimensional grid is converted into a binary stream, and a compression library, such as zlib or Zstandard, is called to compress the binary stream, and the compressed data is used as the initial grid basic information array.
[0068] In this embodiment, three-dimensional grid information is extracted from a three-dimensional grid file; based on a preset grid basic information array structure, the three-dimensional grid information is converted and processed to obtain a grid basic information array; the grid basic information array is binary converted and compressed to obtain an initial grid basic information array, thereby realizing parsing and processing of the three-dimensional grid data, and converting the grid file into the initial grid basic information array. Under the premise of accurately representing the three-dimensional grid, it can reduce the storage space occupied, speed up the data transmission and reading speed, and thus accelerate the rendering process, thereby realizing the rendering of massive three-dimensional grid data.
[0069] S102: Decompressing the initial grid basic information array using multiple threads to obtain a target grid basic information array.
[0070] In this embodiment, the initial mesh basic information array is decompressed by multi-threading in the WebGL front end to obtain the target mesh basic information array for subsequent three-dimensional mesh rendering.
[0071] S103: In response to the mesh editing state selected by the user, determining a target mesh rendering mode.
[0072] S104: Rendering the target grid basic information array according to the target grid rendering process corresponding to the preset target grid rendering mode.
[0073] In this embodiment, based on the editing state controller and rendering mode controller pre-created in WebGL, by judging the editing state of the mesh to be rendered, according to the corresponding target mesh rendering mode, mesh vertex primitives, mesh edge primitives, and mesh face primitives are constructed according to actual needs, and the same type of mesh primitives are merged into one primitive to render multiple types of primitives separately at the same time. Specifically, mesh data rendering and display are performed based on the basic primitives of points, lines, and triangles supported by WebGL. The vertex buffer object stores the vertex data in the GPU's memory, passes the vertex data to the vertex shader, and transforms and colors the vertices; the index buffer object stores the index data in the GPU's memory and passes the vertex data to the fragment shader; the fragment shader is responsible for shading the pixels, receiving the vertex data passed by the vertex shader, calculating the color value of the pixel, and outputting it to the screen to complete the rendering process of the three-dimensional mesh.
[0074] It is understandable that WebGL combines the same type of elements using the same material and shader into one drawing command call, and combines the points, lines, and surfaces in the three-dimensional grid into three types of elements according to their types, and calls the corresponding drawing commands for rendering simultaneously to reduce overhead and thus improve performance.
[0075] In this embodiment, the acquired three-dimensional mesh file is parsed and processed to determine an initial mesh basic information array; a group of initial mesh basic information arrays are used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension, respectively, and can comprehensively and accurately describe the three-dimensional mesh; then, multi-threading is used to decompress the initial mesh basic information array to improve data processing capabilities to process large-scale three-dimensional mesh data and obtain a target mesh basic information array; in response to the mesh editing state selected by the user, a target mesh rendering mode is determined; and according to the preset target mesh rendering process corresponding to the target mesh rendering mode, the target mesh basic information array is rendered and processed, which can adapt to different simulation scenarios and needs, generate a three-dimensional mesh that meets actual needs, and improve mesh rendering quality.
[0076] Furthermore, based on the above embodiment, the mesh editing state includes an editing state and a non-editing state. In the editing state, mesh vertices and edges can be picked and edited, while in the non-editing state, only data rendering is performed and object picking is not supported.
[0077] The following describes an example implementation method for determining a target mesh rendering mode in response to a user-selected mesh editing state; and rendering the target mesh basic information array according to a preset target mesh rendering process corresponding to the target mesh rendering mode. This implementation method includes the following steps:
[0078] S1031: In response to the mesh editing state selected by the user being the editing state, determining that the target mesh rendering mode is a mesh face rendering mode, an editable mesh vertex rendering mode, or an editable mesh edge rendering mode.
[0079] In this embodiment, when the mesh editing state selected by the user is the editing state, the mesh face rendering mode, the editable mesh vertex rendering mode, and the editable mesh edge rendering mode are started, and S1041-S1044 are executed through the WebGL front end to realize the rendering of mesh vertices, mesh edges and mesh faces, and support interactive picking operations of mesh vertices and mesh edges based on user needs.
[0080] S1032: In response to the mesh editing state selected by the user being the non-editing state, determining that the target mesh rendering mode is a mesh edge rendering mode and a mesh face rendering mode.
[0081] In this embodiment, when the user selects the non-editing state for the mesh editing, the mesh edge rendering mode and the mesh face rendering mode are enabled, and steps S1041 and S1044-S1045 are executed to render the mesh edges and mesh faces in accordance with the user's rendering selection, matching the mesh edge rendering mode and the mesh face rendering mode. It is understood that the mesh edge rendering mode and the mesh face rendering mode can be enabled separately or simultaneously.
[0082] S1041: Obtaining position information and attribute information of mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array.
[0083] In this embodiment, the mesh vertex index array and the mesh vertex attribute array are traversed to obtain the position information and attribute information of the mesh vertices in the three-dimensional mesh, including the longitude, latitude, and altitude of the mesh vertices, and convert them into Cartesian coordinates and store them as a one-dimensional array in the form of (x, y, z).
[0084] S1042: In the editable mesh vertex rendering mode, in response to an event interaction operation of a first target mesh vertex selected by a user, performing editing processing and rendering processing on the first target mesh vertex.
[0085] In this embodiment, in the editable mesh vertex rendering mode, vertex rendering is achieved through primitive drawing, and in response to event interaction operations performed by the user through the mouse, the index of the mesh vertex is obtained, the corresponding attribute field value is obtained based on the index, and the selected first target mesh vertex is edited and rendered.
[0086] S1043: In the editable mesh edge rendering mode, based on the mesh vertex index array and the mesh vertex attribute array, in response to the user's event interaction operation on the selected at least two second target mesh vertices, the mesh edges corresponding to the at least two second target mesh vertices are edited and rendered.
[0087] In this embodiment, in the editable mesh edge rendering mode, based on the mesh vertex index array and the mesh vertex attribute array, the coordinates of the mesh vertices at both ends of each mesh edge are obtained with the indices of two vertices as a group to construct the spatial object of each mesh edge, and then the spatial objects of all mesh edges are merged into the same primitive for batch processing; after a single spatial object is constructed, the vertex index of the mesh edge is written into the spatial object entity, so that the vertex index can be obtained through interaction, and then the attribute information of the mesh vertex and the three-dimensional mesh associated with the mesh vertex can be obtained through the vertex index for editing.
[0088] S1044: In the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the correspondence between the preset attribute values and colors; the attribute values are the values corresponding to the mesh vertices in the mesh vertex attribute array under the preset vertex attributes.
[0089] In this embodiment, in mesh surface rendering mode, based on the position and attribute information of the mesh vertices, an attribute field in the attribute information is designated to control the mesh color, and a custom mapping relationship between the color table and the attribute value of the attribute field is defined. The attribute value of each vertex is converted into a color array and stored flatly. The mesh surface index array is then traversed, starting from the initial value in the mesh surface index array, and the first and last index values in each group of four indexes are determined to be equal. If the first and last index values are equal, the first three index values are stored. If the first and last index values are not equal, a group of diagonally connected quadrilateral meshes is split into two triangular meshes, and the index values of the vertices in these two triangular meshes are stored separately. For example, if a quadrilateral network has four mesh vertices A, B, C, and D, and AC is used as the diagonal line, the two split triangular meshes are the triangular meshes corresponding to vertices A, B, and C, and the triangular meshes corresponding to vertices A, C, and D, respectively. The spatial object of the mesh surface is then constructed based on the processed vertices, colors, and indices, and the mesh surface rendering process is implemented by primitive drawing.
[0090] It is understandable that the execution order of S1042-1044 is not limited and they can be executed simultaneously; they can also be executed selectively according to user needs.
[0091] In this embodiment, in response to the user selecting the mesh editing state as the edit state, the target mesh rendering mode is determined to be a mesh face rendering mode, an editable mesh vertex rendering mode, or an editable mesh edge rendering mode; the position information and attribute information of the mesh vertices in the three-dimensional mesh are obtained by traversing the mesh vertex index array and the mesh vertex attribute array; in the editable mesh vertex rendering mode, in response to an event interaction operation on a first target mesh vertex selected by the user, the first target mesh vertex is edited and rendered; in the editable mesh edge rendering mode, based on the mesh vertex index array and the mesh vertex attribute array, in response to an event interaction operation on at least two second target mesh vertices selected by the user, mesh edges corresponding to at least two second target mesh vertices are edited and rendered; in the mesh face rendering mode, based on the position information and attribute information of the mesh vertices, the mesh faces of the three-dimensional mesh are rendered according to a preset correspondence between attribute values and colors; the attribute values are the values corresponding to the mesh vertices in the mesh vertex attribute array under the preset vertex attributes, thereby achieving accurate rendering in different rendering modes and improving rendering efficiency.
[0092] S1045: In the mesh edge rendering mode, the index information of the mesh edge is read from the mesh edge index array, and based on the position information and attribute information of the mesh vertices, the mesh edge of the three-dimensional mesh is treated as a spatial object, and the mesh edge is rendered by primitive drawing.
[0093] In this embodiment, similar to the mesh surface rendering mode, by reading the index information of the mesh edge from the mesh edge index array, all mesh edges are regarded as a whole spatial object, and the rendering processing of the mesh edge is realized in the form of three-dimensional lines through primitive drawing, which will not be repeated here.
[0094] In this embodiment, in response to the user selecting the mesh editing state as the non-editing state, the target mesh rendering mode is determined to be the mesh edge rendering mode and the mesh face rendering mode; by traversing the mesh vertex index array and the mesh vertex attribute array, the position information and attribute information of the mesh vertices in the three-dimensional mesh are obtained; in the mesh face rendering mode, based on the position information and attribute information of the mesh vertices, the mesh face of the three-dimensional mesh is rendered according to the correspondence between the preset attribute value and the color; the attribute value is the value corresponding to the mesh vertex in the mesh vertex attribute array under the preset vertex attribute; in the mesh edge rendering mode, the index information of the mesh edge is read from the mesh edge index array, and based on the position information and attribute information of the mesh vertex, the mesh edge of the three-dimensional mesh is regarded as a spatial object, and the mesh edge is rendered by primitive drawing, thereby achieving accurate rendering in different rendering modes and improving rendering efficiency.
[0095] Furthermore, based on the above embodiment, when the mesh editing state selected by the user is the editing state, the mesh editing state also includes a mesh vertex threshold editing state, which is used to control whether the three-dimensional mesh is split in the editing state so that the local mesh in the three-dimensional mesh can be rendered.
[0096] Based on the above embodiment, the method can also perform editing and rendering on the three-dimensional mesh through the following steps, which specifically include:
[0097] S105: When it is determined that the number of mesh vertices in the editing range is greater than a preset mesh vertex threshold and the number of mesh vertices is less than the total number of mesh vertices of multiple three-dimensional meshes, the target three-dimensional mesh in the editing range is split, and a local mesh basic information array corresponding to the target three-dimensional mesh is extracted from the target mesh basic information array.
[0098] The editing range is the grid range displayed by the user by zooming in and out.
[0099] In this embodiment, the WebGL front-end dynamically obtains the field of view based on the current scene zoom scale and uses this as the editing range of the mesh. The mesh vertex index array is traversed to obtain the latitude and longitude coordinate information of each three-dimensional mesh, and spatial analysis is performed based on the editing range to calculate the number of mesh vertices within the initial editing range. When it is determined that the number of mesh vertices in the editing range is greater than the mesh vertex threshold, the editing threshold is set in the editing state, and the number of mesh vertices is less than the total number of mesh vertices of all three-dimensional meshes, mesh splitting is performed. If the number of mesh vertices includes the mesh vertices of all three-dimensional meshes, the target mesh rendering mode in the editing state is directly started.
[0100] When performing data splitting processing on the target mesh basic information array, the initial mesh face index array is traversed, and the multi-vertex coordinates of each mesh are determined by the face index to determine whether all vertices of each mesh are within the editing range. The coordinates of the mesh vertices that meet the conditions are saved as a local mesh vertex index array, and a new local mesh face index array is calculated. At the same time, the initial mesh edge index array is traversed, and the two vertex coordinates of each mesh edge are determined by the edge index to determine whether both vertices are within the editing range. The local vertex index associated with the original vertex is obtained based on the mapping relationship between the initial and local mesh vertices. If both vertices have new indices, they meet the conditions, and the local mesh edge index array is composed and created according to the new local vertex index, thereby obtaining the local mesh basic information array corresponding to the target three-dimensional mesh.
[0101] S106: Constructing an initial index mapping relationship between the local grid basic information array and the target grid basic information array corresponding to the target three-dimensional grid.
[0102] In this embodiment, the initial and local mesh vertex mapping relationship, mesh face index mapping relationship, and initial and local mesh edge mapping relationship are established before and after the splitting process as the initial index mapping relationship between the local mesh basic information array and the target mesh basic information array corresponding to the target three-dimensional mesh.
[0103] S107: In response to the user's event interaction operation on the target three-dimensional grid, the initial index mapping relationship is updated to obtain the target index mapping relationship, and the target grid basic information array of the target three-dimensional grid is updated according to the target index mapping relationship to re-render the target three-dimensional grid.
[0104] In this embodiment, based on the created local mesh basic information array, the mesh face rendering mode, the editable mesh vertex rendering mode, and the editable mesh edge rendering mode are enabled simultaneously, and the split local mesh is rendered on the WebGL front end. In the editable mesh vertex rendering mode and / or the editable mesh edge rendering mode, editing operations such as vertex position modification, vertex deletion, vertex addition, mesh edge replacement, and mesh edge deletion are performed according to actual needs.
[0105] Specifically, after entering the editable mesh vertex rendering mode, the user can choose to establish axes in the x, y, and z directions based on the Cartesian coordinate system by right-clicking the mesh vertex, modify the position of the mesh vertex by dragging the axis, and update the new coordinates to the mesh vertex attribute array according to the vertex index; right-clicking the vertex can also select the mesh vertex deletion operation, delete it by finding the mesh face and mesh edge related to the vertex, and recalculate the index of the vertices after this index based on the current vertex index, and update the new index to each mesh face index array and edge index array; you can also add a new mesh vertex entrance, click the map to select the new vertex position, and generate a mesh vertex index, guide the connection to other existing vertices to form a closed triangle or quadrilateral, and then append the mesh face index and new edge index of the new graphic to the mesh basic information array. After entering Editable Mesh Edge Rendering mode, users can swap the common edges of two adjacent triangles by right-clicking. The angle between the shared edges determines whether the edges can be swapped, and after swapping, there will only be two triangles. Users can also right-click on an edge to select and delete it. This allows users to find the mesh faces associated with the edge based on vertex indices and delete the indices. If a vertex exists after deleting an edge that does not form a mesh face, the vertex is deleted and the index is updated according to the aforementioned vertex deletion logic.
[0106] After completing the update of the initial index mapping relationship and obtaining the target index mapping relationship, it is necessary to update the index of the split local grid basic information array and the target grid basic information array and merge the grids to perform grid rendering according to the updated target grid basic information array.
[0107] In this embodiment, when it is determined that the number of mesh vertices in the editing range is greater than a preset mesh vertex threshold and the number of mesh vertices is less than the total number of mesh vertices of multiple three-dimensional meshes, the target three-dimensional mesh within the editing range is split, and the local mesh basic information array corresponding to the target three-dimensional mesh is extracted from the target mesh basic information array; an initial index mapping relationship is constructed between the local mesh basic information array and the target mesh basic information array corresponding to the target three-dimensional mesh; in response to a user's event interaction operation on the target three-dimensional mesh, the initial index mapping relationship is updated to obtain a target index mapping relationship, and based on the target index mapping relationship, the target mesh basic information array of the target three-dimensional mesh is updated to re-render the target three-dimensional mesh, thereby solving the performance bottleneck of large-scale mesh editing and improving the rendering speed while ensuring data consistency.
[0108] See also Figure 2 , which is a structural diagram of a three-dimensional grid rendering device provided by an embodiment of the present application. Figure 2 As shown, the device 20 includes a file parsing processing module 21 , a data decompression processing module 22 , a rendering mode determination module 23 and a three-dimensional mesh rendering module 24 .
[0109] Among them, the file parsing and processing module 21 is used to parse and process the acquired three-dimensional mesh file to determine the initial mesh basic information array; a group of initial mesh basic information arrays are used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension respectively; the data decompression processing module 22 is used to use multi-threading to decompress the initial mesh basic information array to obtain the target mesh basic information array; the rendering mode determination module 23 is used to determine the target mesh rendering mode in response to the mesh editing state selected by the user; the three-dimensional mesh rendering module 24 is used to render the target mesh basic information array according to the target mesh rendering process corresponding to the preset target mesh rendering mode.
[0110] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0111] Furthermore, based on the above embodiment, the file parsing and processing module 21 is specifically used to extract three-dimensional grid information from the three-dimensional grid file; the three-dimensional grid information includes grid points, grid topological relationships and grid properties of the three-dimensional grid; based on the preset grid basic information array structure, the three-dimensional grid information is converted and processed to obtain a grid basic information array; the grid basic information array is binary converted and compressed to obtain an initial grid basic information array.
[0112] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0113] Furthermore, based on the above embodiment, the mesh basic information array of the three-dimensional mesh in the file parsing and processing module 21 includes a mesh vertex index array, a mesh vertex attribute array, a mesh face index array, and a mesh edge index array; the mesh vertex index array is used to store the vertex index of each mesh vertex in the three-dimensional mesh; the mesh vertex attribute array is used to store the vertex attribute of each mesh vertex in the three-dimensional mesh; the mesh edge index array is used to store the vertex index corresponding to each mesh edge in the three-dimensional mesh, and the mesh face index array is used to store the vertex index corresponding to the three-dimensional mesh.
[0114] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0115] Further, based on the above embodiment, if the mesh editing state is the editing state, the rendering mode determination module 23 is used to determine the target mesh rendering mode as the mesh surface rendering mode, the editable mesh vertex rendering mode, and the editable mesh edge rendering mode in response to the mesh editing state selected by the user as the editing state.
[0116] The three-dimensional mesh rendering module 24 is used to obtain the position information and attribute information of the mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array; in the editable mesh vertex rendering mode, in response to the event interaction operation of the first target mesh vertex selected by the user, the first target mesh vertex is edited and rendered; in the editable mesh edge rendering mode, based on the mesh vertex index array and the mesh vertex attribute array, in response to the event interaction operation of the user on at least two second target mesh vertices selected, the mesh edges corresponding to at least two second target mesh vertices are edited and rendered; in the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the correspondence between preset attribute values and colors; the attribute value is the value corresponding to the mesh vertex in the mesh vertex attribute array under the preset vertex attribute.
[0117] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0118] Further, based on the above embodiment, if the mesh editing state is a non-editing state, the rendering mode determination module 23 is used to determine the target mesh rendering mode as a mesh edge rendering mode and a mesh face rendering mode in response to the mesh editing state selected by the user being a non-editing state.
[0119] The three-dimensional mesh rendering module 24 is used to obtain the position information and attribute information of the mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array; in the mesh edge rendering mode, the index information of the mesh edge is read from the mesh edge index array, and based on the position information and attribute information of the mesh vertices, the mesh edge of the three-dimensional mesh is treated as a spatial object, and the mesh edge is rendered by primitive drawing; in the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the preset correspondence between attribute values and colors.
[0120] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0121] Furthermore, based on the above embodiment, when the mesh editing state selected by the user is the editing state, the mesh editing state in the rendering mode determination module 23 also includes a mesh vertex threshold editing state, which is used to control whether the three-dimensional mesh is split in the editing state so that the local mesh in the three-dimensional mesh can be rendered.
[0122] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0123] Further, based on the above embodiment, when the mesh editing state is the mesh vertex threshold editing state, the three-dimensional mesh rendering module 24 is further used to split the target three-dimensional mesh within the editing range when it is determined that the number of mesh vertices in the editing range is greater than the preset mesh vertex threshold and the number of mesh vertices is less than the total number of mesh vertices of multiple three-dimensional meshes, and extract the local mesh basic information array corresponding to the target three-dimensional mesh from the target mesh basic information array; the editing range is the mesh range displayed by the user through the zoom scale; construct an initial index mapping relationship between the local mesh basic information array and the target mesh basic information array corresponding to the target three-dimensional mesh; in response to the user's event interaction operation on the target three-dimensional mesh, update the initial index mapping relationship to obtain the target index mapping relationship, and update the target mesh basic information array of the target three-dimensional mesh according to the target index mapping relationship to re-render the target three-dimensional mesh.
[0124] A three-dimensional mesh rendering device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0125] See also Figure 3 , which is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, including:
[0126] Memory 11, for storing computer programs;
[0127] The processor 12 is configured to implement the steps of a three-dimensional mesh rendering method described in any of the above method embodiments when executing the computer program.
[0128] In this embodiment, the device may be a vehicle-mounted computer, a PC (Personal Computer), or a terminal device such as a smart phone, a tablet computer, a PDA, or a portable computer.
[0129] The device may include a memory 11 , a processor 12 , and a bus 13 .
[0130] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the device, such as the hard disk of the device. In other embodiments, the memory 11 can also be an external storage device of the device, such as a plug-in hard disk equipped on the device, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 11 can also include both the internal storage unit of the device and an external storage device. The memory 11 can not only be used to store application software installed on the device and various types of data, such as program code for executing a three-dimensional mesh rendering method, but can also be used to temporarily store data that has been output or is to be output. In some embodiments, the processor 12 can be a central processing unit (CPU).
[0131] In some embodiments, the processor 12 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, used to run the program code stored in the memory 11 or process data, such as the program code for executing the three-dimensional mesh rendering method.
[0132] The bus 13 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0133] Furthermore, the device may also include a network interface 14, which may optionally include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the device and other electronic devices.
[0134] Optionally, the device may further include a user interface 15, which may include a display and an input unit such as a keyboard. The optional user interface 15 may also include a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display may also be appropriately referred to as a display screen or display unit, and is used to display information processed in the device and to display a visual user interface.
[0135] Figure 3 Only the device with components 11-15 is shown, and it will be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation of the device, and may include fewer or more components than shown, or combine certain components, or arrange the components differently.
[0136] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, an embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the three-dimensional mesh rendering method described in any of the above embodiments.
[0137] The computer-readable media of the embodiments of the present application include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0138] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the three-dimensional mesh rendering method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0139] It should be noted that the various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for methods, devices, electronic devices and media, since they are basically similar to the method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiments. The methods, devices, electronic devices and media described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement them without expending any creative effort.
[0140] The above is merely one specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A three-dimensional mesh rendering method, characterized in that: include: Analyze the acquired three-dimensional grid file to determine the initial grid basic information array; A set of initial mesh basic information arrays is used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension respectively; Decompressing the initial grid basic information array using multiple threads to obtain a target grid basic information array; In response to a user-selected mesh editing state, determining a target mesh rendering mode; The target grid basic information array is rendered according to the preset target grid rendering process corresponding to the target grid rendering mode.
2. The method according to claim 1, characterized in that The obtained three-dimensional grid file is parsed and processed to determine the initial grid basic information array, including: Extracting three-dimensional grid information from a three-dimensional grid file; the three-dimensional grid information includes grid points, grid topology relationships, and grid properties of the three-dimensional grid; Based on a preset grid basic information array structure, converting the three-dimensional grid information to obtain a grid basic information array; The grid basic information array is subjected to binary conversion and compression processing to obtain an initial grid basic information array.
3. The method according to claim 2, characterized in that The mesh basic information array of the three-dimensional mesh includes a mesh vertex index array, a mesh vertex attribute array, a mesh face index array and a mesh edge index array; the mesh vertex index array is used to store the vertex index of each mesh vertex in the three-dimensional mesh; the mesh vertex attribute array is used to store the vertex attribute of each mesh vertex in the three-dimensional mesh; the mesh edge index array is used to store the vertex index corresponding to each mesh edge in the three-dimensional mesh, and the mesh face index array is used to store the vertex indexes corresponding to the vertices constituting the three-dimensional mesh.
4. The method according to claim 1, wherein If the mesh editing state is the editing state, determining a target mesh rendering mode in response to the mesh editing state selected by the user includes: In response to the user selecting the mesh editing state as the editing state, determining the target mesh rendering mode as a mesh face rendering mode, an editable mesh vertex rendering mode, or an editable mesh edge rendering mode; The rendering process of the target grid basic information array is performed according to the preset target grid rendering process corresponding to the target grid rendering mode, including: Obtaining position information and attribute information of mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array; In the editable mesh vertex rendering mode, in response to an event interaction operation of a first target mesh vertex selected by a user, performing editing processing and rendering processing on the first target mesh vertex; In the editable mesh edge rendering mode, based on the mesh vertex index array and the mesh vertex attribute array, in response to an event interaction operation of the user on the at least two second target mesh vertices selected, performing editing processing and rendering processing on the mesh edges corresponding to the at least two second target mesh vertices; In the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the correspondence between preset attribute values and colors; the attribute values are the values corresponding to the mesh vertices in the mesh vertex attribute array under the preset vertex attributes.
5. The method according to claim 1, wherein If the mesh editing state is a non-editing state, determining a target mesh rendering mode in response to the mesh editing state selected by the user includes: In response to the mesh editing state selected by the user being a non-editing state, determining the target mesh rendering mode to be a mesh edge rendering mode and a mesh face rendering mode; The rendering process of the target grid basic information array is performed according to the preset target grid rendering process corresponding to the target grid rendering mode, including: Obtaining position information and attribute information of mesh vertices in the three-dimensional mesh by traversing the mesh vertex index array and the mesh vertex attribute array; In mesh edge rendering mode, index information of mesh edges is read from the mesh edge index array, and based on the position information and attribute information of the mesh vertices, the mesh edges of the three-dimensional mesh are treated as spatial objects, and the mesh edges are rendered by primitive drawing; In the mesh surface rendering mode, based on the position information and attribute information of the mesh vertices, the mesh surface of the three-dimensional mesh is rendered according to the preset corresponding relationship between the attribute value and the color.
6. The method according to claim 4, characterized in that When the mesh editing state selected by the user is the editing state, the mesh editing state also includes a mesh vertex threshold editing state, which is used to control whether to split the three-dimensional mesh in the editing state so that local meshes in the three-dimensional mesh can be rendered.
7. The method according to claim 6, characterized in that The method further comprises: When it is determined that the number of mesh vertices in the editing range is greater than a preset mesh vertex threshold and the number of mesh vertices is less than the total number of mesh vertices of the plurality of three-dimensional meshes, splitting the target three-dimensional mesh within the editing range and extracting a local mesh basic information array corresponding to the target three-dimensional mesh from the target mesh basic information array; the editing range is the mesh range displayed by the user through zooming; Constructing an initial index mapping relationship between the local grid basic information array and the target grid basic information array corresponding to the target three-dimensional grid; In response to the user's event interaction operation on the target three-dimensional grid, the initial index mapping relationship is updated to obtain a target index mapping relationship, and according to the target index mapping relationship, the target grid basic information array of the target three-dimensional grid is updated to re-render the target three-dimensional grid.
8. A three-dimensional grid rendering device, characterized in that: include: A file parsing and processing module is used to parse and process the acquired three-dimensional grid file to determine an initial grid basic information array; A set of initial mesh basic information arrays is used to represent a three-dimensional mesh in vertex dimension, edge dimension, face dimension and vertex attribute dimension respectively; A data decompression processing module is used to decompress the initial grid basic information array using multiple threads to obtain a target grid basic information array; a rendering mode determination module, configured to determine a target mesh rendering mode in response to a mesh editing state selected by a user; The three-dimensional mesh rendering module is used to render the target mesh basic information array according to the preset target mesh rendering process corresponding to the target mesh rendering mode.
9. An electronic device, characterized in that: The device includes: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.