Three-dimensional data layering and blocking method and device based on glTF data format

By introducing three-dimensional data hierarchy and grid chunking technologies in glTF format, the problem of large-scale three-dimensional data download bandwidth and long time in web applications is solved, efficient loading and rendering is achieved, and user experience is improved.

CN117218314BActive Publication Date: 2025-04-04SHENZHEN JIMUYIDA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311093265.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2025-04-04
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

The existing glTF format does not directly support three-dimensional data hierarchy and meshing, resulting in large-scale three-dimensional data downloading in web applications that are under high bandwidth pressure and long download time, affecting the user experience, and consuming a large amount of rendering resources, which may cause system lag or crash.

Method used

A three-dimensional data hierarchical blocking method based on glTF data format is proposed. By obtaining three-dimensional scene data, calculating the outer bounding box, layering node data, performing grid blocking, associating nodes and grids, and reconstructing the bin data, associating it with glTF format data, realizing on-demand loading.

Benefits of technology

Through hierarchical and grid chunking technology, the size of a single bin data file is reduced, loading efficiency is improved, network bandwidth pressure is reduced, user experience is improved, and the consumption of rendering resources is reduced, and the system is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117218314B_ABST
    Figure CN117218314B_ABST
Patent Text Reader

Abstract

According to a three-dimensional data layering and blocking method and device based on the glTF data format provided by the present application, the node data in the glTF format data is layered for each node to obtain layer information, and the layers are grid-blocked according to the layer information. The nodes are associated with the grids to obtain the grid information, and the glTF format data is extended with chapters for storing the layer information and the grid information. The bin data is reconstructed according to the grid to obtain multiple bin data files; the buffer data in the glTF format data is rewritten based on the grid information, and the bin data file is associated with the glTF format data. In the three-dimensional scene, the bin data file is loaded according to the buffer data based on the grid where the camera is located. The method provided by the present application does not need to download the entire bin data, but only needs to download the bin data file associated with the corresponding grid, thereby improving loading efficiency and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional data processing, and is characterized by relating to a three-dimensional data layering and blocking method and device based on the glTF data format. Background Art

[0002] With the continuous development of WebGL technology, the application scale of 3D data is gradually expanding. In order to efficiently process and transmit this data, an efficient data format is needed for storage and transmission.

[0003] The glTF format is a universal 3D data format that can be used to store 3D models, materials, lighting and other information. It has the advantages of being lightweight, scalable and easy to use, and can efficiently store and transmit 3D data. However, the existing glTF format does not provide direct support for 3D data layering and meshing, which brings certain difficulties to practical applications. For example, the number of triangles in a large scene with an actual area of ​​50,000 square meters is usually over 10 million, and the overall data size is over 1G. The large amount of data will put a lot of pressure on the network bandwidth for web application data downloads, and the long download time will also increase the user's waiting time and reduce the user experience. At the same time, the large data size and the number of triangle mesh faces will also consume a lot of rendering resources, not only on PC devices, but especially on mobile devices, which often cause system freezes or even crashes.

[0004] Therefore, finding an appropriate method for processing three-dimensional data based on the glTF data format is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0005] Based on this, it is necessary to propose a three-dimensional data layering method and device based on the glTF data format to solve the technical problems of the existing data format being inconvenient to expand, slow rendering, and high resource consumption.

[0006] The present invention provides a three-dimensional data layering and blocking method based on the glTF data format, comprising:

[0007] Acquire three-dimensional scene data, wherein the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; calculate an outer bounding box of the three-dimensional scene according to the node data;

[0008] Based on the node data, each node is layered to obtain the layer information corresponding to each node;

[0009] Divide each level into grid blocks according to the level information, associate the node with the grid, and obtain grid information corresponding to each node;

[0010] Extending the glTF format data into chapters, wherein the extended chapters are used to store the level information and the grid information;

[0011] The bin data is reconstructed according to the grid to obtain multiple bin data files; the buffer data in the glTF format data is rewritten based on the grid information, the bin data file is associated with the glTF format data, and in the three-dimensional scene, the bin data file is loaded according to the buffer data based on the grid where the camera is located.

[0012] Furthermore, the three-dimensional scene data is obtained, the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; the outer bounding box of the three-dimensional scene is calculated according to the node data; including:

[0013] The node data is node data, each node data corresponds to a three-dimensional feature in the three-dimensional scene, and the three-dimensional feature includes a facade and a display object;

[0014] Traversing the nodes data, respectively calculating the outer bounding boxes of the three-dimensional features according to the coordinate data about the three-dimensional features recorded in the accessor data block in the node data, and obtaining a first outer bounding box;

[0015] An outer bounding box of the three-dimensional scene is calculated according to each of the first outer bounding boxes to obtain a second outer bounding box.

[0016] Furthermore, after obtaining the first outer bounding box and the second outer bounding box, each node is hierarchized based on the node data to obtain hierarchical information corresponding to each node, including:

[0017] Setting layer parameters, and determining the number of layers according to the layer parameters;

[0018] The projection area of ​​the corresponding three-dimensional feature is calculated according to the vertex data in the first outer bounding box. If the projection area is greater than a first threshold, the three-dimensional feature is associated with the first level; if the projection area is less than the first threshold, the three-dimensional feature is associated with the second level; the level attributes corresponding to each three-dimensional feature are obtained, and then the level information corresponding to each three-dimensional feature is obtained.

[0019] Furthermore, the calculating of the projection area corresponding to the three-dimensional feature includes:

[0020] Determine the extraction parameters of each three-dimensional feature, and determine the extraction level of the projection area of ​​the three-dimensional feature according to the extraction parameters, wherein the extraction level includes a general level and a fine level. If the extraction level is the general level, calculate the circumscribed rectangular area of ​​the three-dimensional feature projection according to the vertex data of the first outer bounding box of the corresponding three-dimensional feature to obtain the projection area of ​​the three-dimensional feature of the general level;

[0021] If the level of the layer is refined, the contour shape area of ​​the corresponding three-dimensional feature projection is calculated to obtain the projection area of ​​the three-dimensional feature at the refined level.

[0022] Further, if the projection area is greater than a first threshold, the three-dimensional feature is associated with a first level; if the projection area is less than the first threshold, the three-dimensional feature is associated with a second level; and then includes:

[0023] For the first level, the number of triangle faces of each three-dimensional feature is calculated according to the first outer bounding box to obtain the number of triangle faces of the first level;

[0024] For the second level, the number of triangle faces of each three-dimensional feature is calculated according to the first outer bounding box to obtain the number of triangle faces of the second level;

[0025] The difference between the number of triangular faces in the first layer and the number of triangular faces in the second layer is calculated, and the three-dimensional features at each level are balanced according to the difference, so as to obtain the level information corresponding to each updated three-dimensional feature.

[0026] Furthermore, the grid blocks are divided into blocks for each level according to the level information, and the nodes are associated with the grids to obtain grid information corresponding to each node; including:

[0027] Meshing the horizontal surface of the first level to obtain a block grid on the first level;

[0028] Calculate the projection of each node in the first level on the horizontal plane of the first level to obtain a three-dimensional feature projection surface;

[0029] Determining the plane intersection relationship between the three-dimensional feature projection surface and the grid;

[0030] If the three-dimensional feature projection surface intersects with the grid, the node is associated with the grid intersecting with the node to obtain grid information corresponding to each node.

[0031] Furthermore, the glTF format data is extended with a chapter, and the extended chapter is used to store the level information and the grid information, including:

[0032] The glTF format data is extended with a chapter, and the extended chapter uses a json format to store the level information and the mesh information.

[0033] Furthermore, the reconstructing the bin data according to the grid to obtain a plurality of bin data files; rewriting the buffer data in the glTF format data based on the grid information, and associating the bin data files with the glTF format data, includes:

[0034] The glTF format data also includes mesh data;

[0035] Traverse the meshes data, query the corresponding data in the accessors data block through the mesh data, query the bufferViews data according to the accessor data block, read the binary data from the bin data through the bufferView data, and store all the binary data fields of the mesh into the newly created bin data file;

[0036] Write back the attribute values ​​of bin, buffer, bufferView, and accessor to establish new data correspondence;

[0037] In a three-dimensional scene, in response to a loading request at the camera's viewing angle, a grid at a preset distance from the corresponding grid position is loaded according to the grid position corresponding to the camera's position, and the nodes associated with the grid are displayed on the front end.

[0038] Further, the bin data file is loaded according to the buffer data based on the grid where the camera is located, and then includes:

[0039] Clear the bin data files outside the grid where the camera is located;

[0040] The method further comprises:

[0041] When loading the bin file corresponding to the grid area where the camera is located, obtain the grid projected on other levels, and asynchronously load the bin data file corresponding to the grid on other levels according to the grid on other levels.

[0042] The present invention provides a three-dimensional data layering and blocking device based on the glTF data format, comprising:

[0043] An acquisition module is used to acquire three-dimensional scene data, wherein the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; and an outer bounding box of the three-dimensional scene is calculated according to the node data;

[0044] A stratification module, used to stratify each node based on the node data to obtain the level information corresponding to each node;

[0045] A block division module is used to divide each level into grid blocks according to the level information, associate the node with the grid, and obtain the grid information corresponding to each node;

[0046] An extension module, used for extending the chapter of the glTF format data, wherein the extended chapter is used for storing the level information and the grid information;

[0047] An association module is used to reconstruct the bin data according to the grid to obtain multiple bin data files; rewrite the buffer data in the glTF format data based on the grid information, associate the bin data file with the glTF format data, and load the bin data file according to the buffer data based on the grid where the camera is located in the three-dimensional scene.

[0048] According to a three-dimensional data layering and blocking method and device based on the glTF data format provided by the present application, the beneficial effects are: by acquiring glTF format data and bin data in the three-dimensional scene data, each node is layered according to the node data in the glTF format data to obtain the layer information corresponding to each node, each layer is grid-blocked according to the layer information, the node is associated with the grid to obtain the grid information corresponding to each node, the glTF format data is extended with chapters, the extended chapters are used to store the layer information and the grid information, the bin data is reconstructed according to the grid to obtain multiple bin data files; the buffer data in the glTF format data is rewritten based on the grid information, the bin data file is associated with the glTF format data, and in the three-dimensional scene, the bin data file is loaded according to the buffer data based on the grid where the camera is located. The method provided by the present application does not need to download the entire bin data, but only needs to download the bin data file associated with the corresponding grid, thereby improving loading efficiency and user experience.

[0049] Further, according to the grid position corresponding to the position of the camera, the grid position where the camera is located is exemplarily taken as the center, the grid adjacent to the grid is obtained to form a nine-square grid pattern, and the nodes corresponding to the first nine-square grid are loaded according to the first bin data file corresponding to the mesh data. When the grid position where the camera is located changes, the second bin data file corresponding to the second nine-square grid is obtained again, and the first bin data file is cleared to maintain the amount of data in the memory. In the prior art, when loading three-dimensional scene data on the Web side, it is necessary to download the entire glTF format data and the entire bin data. There is a great pressure on the network bandwidth for the download of Web-side application data. If the download time is too long, it will also increase the waiting time of the user. If the data size and the number of triangular mesh faces are too large, a large amount of rendering resources will be consumed. Therefore, the present invention layers the three-dimensional scene data, meshes the layers, associates the node data with the grid, and reconstructs the entire bin data according to the mesh in the glTF format data. Each mesh corresponds to an independent bin data file, thereby reducing the size of a single bin data file, improving loading efficiency, and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0051] Figure 1 It is a flowchart of a three-dimensional data layering and blocking method based on the glTF data format in one embodiment;

[0052] Figure 2 It is a flowchart of a three-dimensional data layering and blocking device based on the glTF data format in one embodiment;

[0053] Figure 3 Schematic diagram of grid division of layers;

[0054] Figure 4 It is a schematic diagram of the intersection relationship between the projection of node node and the grid;

[0055] Figure 5 Added extended layered information json format data to glTF format data;

[0056] Figure 6 It is the original 3D scene data that has not been layered;

[0057] Figure 7This is a schematic diagram of layer0 after layer processing;

[0058] Figure 8 This is a schematic diagram of layer 1 after layering. DETAILED DESCRIPTION

[0059] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of this application.

[0060] The existing glTF format does not provide direct support for 3D data layering and meshing, which brings certain difficulties to practical applications. For example, for a large scene of 3D data with an actual area of ​​50,000 square meters, the number of triangles is usually over 10 million, and the overall data size is over 1G. The large amount of data will put a lot of pressure on the network bandwidth for web application data downloads, and the long download time will increase the user's waiting time and reduce the user experience. At the same time, the large data size and the number of triangle mesh faces will also consume a lot of rendering resources, not only on PC devices, but especially on mobile devices, which often causes system freezes or even crashes.

[0061] In one embodiment, see Figure 1 As shown, a three-dimensional data layering and blocking method based on the glTF data format is provided, comprising:

[0062] Step S110: Acquire three-dimensional scene data, wherein the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; and calculate an outer bounding box of the three-dimensional scene according to the node data;

[0063] Specifically, glTF format data includes the structure and composition of a 3D scene. A scene has multiple nodes. For example, a 3D scene includes node data such as walls, ground, large physics, and furniture. The outer bounding box of the 3D scene is calculated based on the meshes data set corresponding to each node. The meshes data set defines the geometric shape of the node.

[0064] Step S120: hierarchizing each node based on the node data to obtain hierarchical information corresponding to each node;

[0065] Specifically, the walls, ground, and large physical objects in the node are divided into layer0, and the furniture in the node is divided into layer1. Furniture includes sofas, table lamps, and tables. Each node is associated with its corresponding layer. Of course, the number of specific layers is not limited to two layers. It can be layered according to the size and characteristics of the three-dimensional scene and set more layers.

[0066] Step S130: Divide each level into grid blocks according to the level information, associate the node with the grid, and obtain grid information corresponding to each node;

[0067] Specifically, layer0 is divided into uniform grids according to the xy horizontal plane, layer1 is divided into uniform grids according to the xy horizontal plane, or the xy horizontal plane of the entire three-dimensional scene is divided into uniform grids, each grid is associated with a level, and the grid is associated with a node in the level. When the xy horizontal plane is applicable to the three-dimensional scene as a left-handed coordinate system, that is, when the z-axis is the vertical axis, the plane can be divided according to the specific coordinate system.

[0068] Step S140: Expanding the glTF format data into chapters, where the expanded chapters are used to store the level information and the grid information;

[0069] For details, see Figure 5 As shown, a lightweight data structure json format is used to store the level information corresponding to the node and the grid information corresponding to the node.

[0070] Step S150: reconstruct the bin data according to the grid to obtain multiple bin data files; rewrite the buffer data in the glTF format data based on the grid information, associate the bin data file with the glTF format data, and load the bin data file according to the buffer data based on the grid where the camera is located in the three-dimensional scene.

[0071] Specifically, the glTF format mainly packs all binary bin data into one file. When loading the three-dimensional scene on the Web side, the entire bin data needs to be downloaded. There is a great pressure on the network bandwidth for the Web application data download. The long download time will also increase the user's waiting time and reduce the user experience. At the same time, the large data size and the number of triangles will also consume a lot of rendering resources, which often cause the system to freeze or even crash. Therefore, the entire bin data is reconstructed and divided into multiple bin data files to reduce the size of a single bin data file; and the buffer data in the glTF format data is rewritten, and each single bin data file is associated with the corresponding data in the glTF format data, where the buffer contains structural information such as data buffer views for three-dimensional features, animations, and skinning. Each buffer uses a URL to reference a binary bin data file. Interact according to the definition of the accessor. Exemplarily, when browsing the three-dimensional scene on the Web side, according to the corresponding position of the grid where the camera is located, the grid information of the nine-square matrix centered on the grid is obtained, and the corresponding bin data file is loaded to display the associated nodes.

[0072] According to a three-dimensional data layering and blocking method based on the glTF data format provided by the present application, the beneficial effects are: by acquiring glTF format data and bin data in the three-dimensional scene data, each node is layered according to the node data in the glTF format data to obtain the layer information corresponding to each node, each layer is grid-blocked according to the layer information, the node is associated with the grid to obtain the grid information corresponding to each node, the glTF format data is extended with chapters, the extended chapters are used to store the layer information and the grid information, the bin data is reconstructed according to the grid to obtain multiple bin data files; the buffer data in the glTF format data is rewritten based on the grid information, the bin data file is associated with the glTF format data, and in the three-dimensional scene, the bin data file is loaded according to the buffer data based on the grid where the camera is located. The method provided by the present application does not need to download the entire bin data, but only needs to download the bin data file associated with the corresponding grid, thereby improving loading efficiency and user experience.

[0073] Further, according to the grid position corresponding to the position of the camera, the grid position where the camera is located is exemplarily taken as the center, the grid adjacent to the grid is obtained to form a nine-square grid pattern, and the nodes corresponding to the first nine-square grid are loaded according to the first bin data file corresponding to the mesh data. When the grid position where the camera is located changes, the second bin data file corresponding to the second nine-square grid is obtained again, and the first bin data file is cleared to maintain the amount of data in the memory. In the prior art, when loading three-dimensional scene data on the Web side, it is necessary to download the entire glTF format data and the entire bin data. There is a great pressure on the network bandwidth for the download of Web-side application data. If the download time is too long, it will also increase the waiting time of the user. If the data size and the number of triangular mesh faces are too large, a large amount of rendering resources will be consumed. Therefore, the present invention layers the three-dimensional scene data, meshes the layers, associates the node data with the grid, and reconstructs the entire bin data according to the mesh in the glTF format data. Each mesh corresponds to an independent bin data file, thereby reducing the size of a single bin data file, improving loading efficiency, and improving user experience.

[0074] In one embodiment, the three-dimensional scene data is obtained, the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; and the outer bounding box of the three-dimensional scene is calculated according to the node data; including:

[0075] The node data is node data, each node data corresponds to a three-dimensional feature in the three-dimensional scene, and the three-dimensional feature includes a facade and a display object;

[0076] Traversing the nodes data, respectively calculating the outer bounding boxes of the three-dimensional features according to the coordinate data about the three-dimensional features recorded in the accessor data block in the node data, and obtaining a first outer bounding box;

[0077] Specifically, traverse the nodes in the glTF format data and obtain the attribute values ​​such as "translation", "scale", and "rotation". These attributes respectively record the translation, scaling, and rotation information of the three-dimensional features in the three-dimensional scene. Then obtain the three-dimensional feature mesh number through the "mesh" attribute value, and find the corresponding mesh data information in the meshes data set in the glTF format data according to the mesh number. Through the "POSITION" attribute value, the corresponding data block information can be found in the accessors data set in the glTF data. Finally, according to the "max" and "min" attribute values ​​in the accessor data block combined with the "translation", "scale", and "rotation" data, the maximum and minimum values ​​of the x, y, and z coordinates of the three-dimensional object can be calculated, which is the outer bounding box of the three-dimensional feature.

[0078] An outer bounding box of the three-dimensional scene is calculated according to each of the first outer bounding boxes to obtain a second outer bounding box.

[0079] Specifically, after traversing the three-dimensional features corresponding to all nodes, the outer bounding box of the entire three-dimensional scene can be calculated according to the first outer bounding box of all three-dimensional features in the three-dimensional scene obtained by calculation, thereby obtaining the second outer bounding box.

[0080] In one embodiment, after obtaining the first outer bounding box and the second outer bounding box, the nodes are hierarchized based on the node data to obtain the hierarchical information corresponding to each node, including:

[0081] Setting layer parameters, and determining the number of layers according to the layer parameters;

[0082] The projection area of ​​the corresponding three-dimensional feature is calculated according to the vertex data in the first outer bounding box. If the projection area is greater than a first threshold, the three-dimensional feature is associated with the first level; if the projection area is less than the first threshold, the three-dimensional feature is associated with the second level; the level attributes corresponding to each three-dimensional feature are obtained, and then the level information corresponding to each three-dimensional feature is obtained.

[0083] For details, see Figure 6 , Figure 7 and Figure 8 As shown, according to the projection area of ​​the three-dimensional features corresponding to the node data at its corresponding level, the projection area of ​​the three-dimensional features of the wall and large items is generally larger, greater than the first threshold, and is set at the layer0 layer, that is, the first layer; the projection area of ​​the furniture is smaller than the first threshold, and is set at the layer1 layer, that is, the second layer.

[0084] It should be noted that the three-dimensional features are layered according to their importance attributes, node data is extracted from glTF format data, and it is queried whether there is a layer attribute in the node data. This attribute is added by the user and is used to record the level of the node defined by the user. If the layer attribute does not exist in the node, that is, the user has not defined the level of the point node, then the level is defined according to the projection area of ​​the node.

[0085] It is worth noting that in the layer determination algorithm, the projection area is an important parameter. Generally, it is calculated by the projection area on the xy plane. The larger the projection area, the higher the level of the upgrade. As mentioned above, if the projection area is greater than the first threshold, the layer is upgraded to layer0.

[0086] The first layer, but the projection area of ​​some 3D features with high importance attributes is not large in the xy plane, such as the 3D feature flagpole, so it is not convenient to assign it to a high level, such as layer0. Therefore, the z-axis height information of the 3D feature is also included in the algorithm. The larger the height value, the larger the threshold for the layer level. The probability of being promoted to the upper layer will also increase. When the z-axis height value of the 3D feature is greater than the preset height, the 3D feature is promoted to layer0 for association.

[0087] In one embodiment, the calculating the projection area corresponding to the three-dimensional feature includes:

[0088] Determine the extraction parameters of each three-dimensional feature, and determine the extraction level of the projection area of ​​the three-dimensional feature according to the extraction parameters, wherein the extraction level includes a general level and a fine level. If the extraction level is the general level, calculate the circumscribed rectangular area of ​​the three-dimensional feature projection according to the vertex data of the first outer bounding box of the corresponding three-dimensional feature to obtain the projection area of ​​the three-dimensional feature of the general level;

[0089] If the level of the layer is refined, the contour shape area of ​​the corresponding three-dimensional feature projection is calculated to obtain the projection area of ​​the three-dimensional feature at the refined level.

[0090] Specifically, the layer parameters are designed to be two levels. The ordinary level is to calculate the projection circumscribed rectangle of the node node, traverse the nodes in the glTF format data, and obtain the attribute values ​​such as "translation", "scale", and "rotation". These attributes record the translation, scaling, and rotation information of the three-dimensional features in the three-dimensional scene. Then, the three-dimensional feature mesh serial number is obtained through the "mesh" attribute value, and the corresponding mesh data information is found in the meshes data set in the glTF format data according to the mesh serial number. Through the "POSITION" attribute value, the corresponding data block information can be found in the accessors data set in the glTF data. Finally, according to the "max" and "min" attribute values ​​in the accessor data block combined with the "translation", "scale", and "rotation" data, the maximum and minimum values ​​of the x and y coordinates of the three-dimensional object can be calculated, and the "max" and "min" of the node node can be obtained. Here, only the projection area is calculated, so there is no need to calculate the z-axis coordinate value. The rectangular area is calculated through the maximum and minimum values ​​of the x and y axes. The fine-level calculation is to obtain the attribute values ​​of "translation", "scale", and "rotation" from the node data, and obtain the corresponding accessors-

[0091] >bufferViews, and finally read and parse all the 3D point coordinate data of the node data from the corresponding bin data to obtain the plane projection outline of the node node, and then calculate the projection area of ​​the node node by the area calculation method without planning the plane figure.

[0092] In one embodiment, if the projected area is greater than a first threshold, the three-dimensional feature is associated with a first level; if the projected area is less than the first threshold, the three-dimensional feature is associated with a second level; and then includes:

[0093] For the first level, the number of triangle faces of each three-dimensional feature is calculated according to the first outer bounding box to obtain the number of triangle faces of the first level;

[0094] For the second level, the number of triangle faces of each three-dimensional feature is calculated according to the first outer bounding box to obtain the number of triangle faces of the second level;

[0095] The difference between the number of triangular faces in the first layer and the number of triangular faces in the second layer is calculated, and the three-dimensional features at each level are balanced according to the difference, so as to obtain the level information corresponding to each updated three-dimensional feature.

[0096] Specifically, balance the number of triangles at each layer and distribute the nodes evenly to each layer.

[0097] In one embodiment, see Figure 3 and Figure 4 As shown, the grid blocks are divided into each level according to the level information, the nodes are associated with the grids, and the grid information corresponding to each node is obtained; including:

[0098] Meshing the horizontal surface of the first level to obtain a block grid on the first level;

[0099] Calculate the projection of each node in the first level on the horizontal plane of the first level to obtain a three-dimensional feature projection surface;

[0100] Determining the plane intersection relationship between the three-dimensional feature projection surface and the grid;

[0101] If the three-dimensional feature projection surface intersects with the grid, the node is associated with the grid intersecting with the node to obtain grid information corresponding to each node.

[0102] Specifically, the first level is grid-divided to obtain a plurality of grids of size m*n (m may be equal to n). For example, the grid matrix a of the first level is obtained. ij , obtain the horizontal plane projection of each node in the first level, obtain the three-dimensional feature projection surface, determine the plane intersection relationship between the three-dimensional feature projection surface and the grid, and determine the grid into which the three-dimensional feature projection surface falls. For example, the three-dimensional feature wall surface in the first layer layer0 falls into grid a 12 , then the wall node data corresponding to the three-dimensional feature is combined with the grid a 12 The grid corresponds to the grid.

[0103] In one embodiment, the glTF format data is extended with a chapter, wherein the extended chapter is used to store the level information and the mesh information, including:

[0104] The glTF format data is extended with a chapter, and the extended chapter uses a json format to store the level information and the mesh information.

[0105] In one of the embodiments, reconstructing the bin data according to the grid to obtain a plurality of bin data files; rewriting the buffer data in the glTF format data based on the grid information, and associating the bin data files with the glTF format data, comprises:

[0106] The glTF format data also includes mesh data;

[0107] The glTF format data also includes mesh data;

[0108] Traverse the meshes data, query the corresponding data in the accessors data block through the mesh data, query the bufferViews data according to the accessor data block, read the binary data from the bin data through the bufferView data, and store all the binary data fields of the mesh into the newly created bin data file;

[0109] Write back the attribute values ​​of bin, buffer, bufferView, and accessor to establish new data correspondence;

[0110] In a three-dimensional scene, in response to a loading request at the camera's viewing angle, a grid at a preset distance from the corresponding grid position is loaded according to the grid position corresponding to the camera's position, and the nodes associated with the grid are displayed on the front end.

[0111] Specifically, traverse the meshes data in glTF, query the corresponding data in accessors through the primitives attribute value in the mesh data, and then query the corresponding data in bufferViews according to the bufferView attribute value in the accessor data. Read binary data from the corresponding bin data through the buffer, byteOffset, byteLength and other attribute values ​​in the bufferView data, and store all binary data fields of the mesh in the newly created bin data file. Finally, write back the attribute values ​​of bin, buffer, bufferView, and accessor to establish a new data correspondence; update the buffer data in glTF, rewrite the attribute values ​​of bin, buffer, bufferView, and accessor in glTF, and establish a new data correspondence between mesh, accessor, bufferView, and buffer, so that the newly created bin data can be effectively associated with the glTF data.

[0112] In a three-dimensional scene, in response to a loading request at the camera's viewing angle, a grid at a preset distance from the corresponding grid position is loaded according to the grid position corresponding to the camera's position, and the nodes associated with the grid are displayed on the front end.

[0113] In one embodiment, the bin data file is loaded according to the buffer data based on the grid where the camera is located, and then includes:

[0114] Clear the bin data files outside the grid where the camera is located;

[0115] The method further comprises:

[0116] When loading the bin file corresponding to the grid area where the camera is located, obtain the grid projected on other levels, and asynchronously load the bin data file corresponding to the grid on other levels according to the grid on other levels.

[0117] Specifically, according to the grid position corresponding to the camera position, the grid position of the camera is exemplarily taken as the center to obtain the grid adjacent to the grid to form a nine-square grid pattern, and the nodes corresponding to the first nine-square grid are loaded according to the first bin data file corresponding to the mesh data.

[0118] When the grid position of the camera changes, the second bin data file corresponding to the second nine-square grid is re-acquired, and the first bin data file is cleared to maintain the data size in the memory.

[0119] In one embodiment, see Figure 2 As shown, a three-dimensional data layering and blocking device based on the glTF data format is provided, comprising:

[0120] The acquisition module 100 is used to acquire three-dimensional scene data, wherein the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; and an outer bounding box of the three-dimensional scene is calculated based on the node data;

[0121] A layering module 200 is used to layer each node based on the node data to obtain layer information corresponding to each node;

[0122] A block division module 300 is used to divide each level into grid blocks according to the level information, associate the node with the grid, and obtain the grid information corresponding to each node;

[0123] An extension module 400, used for extending the glTF format data into an extended chapter, wherein the extended chapter is used for storing the level information and the mesh information;

[0124] The association module 500 is used to reconstruct the bin data according to the grid to obtain multiple bin data files; rewrite the buffer data in the glTF format data based on the grid information, associate the bin data file with the glTF format data, and load the bin data file according to the buffer data based on the grid where the camera is located in the three-dimensional scene.

[0125] In one of the embodiments, a readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the processor executes the steps of the three-dimensional data layering and blocking method based on the glTF data format as described above.

[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0127] It should be noted that when an element is referred to as being "fixed on" or "set on" another component, it can be directly on the other component or indirectly set on the other component; when a component is referred to as being "connected to" another component, it can be directly connected to the other component or indirectly connected to the other component.

[0128] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.

[0129] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the conditions under which this application can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in this application without affecting the effects and purposes that can be achieved by this application.

[0130] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0131] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A three-dimensional data layering and blocking method based on glTF data format, characterized in that: include: Acquire three-dimensional scene data, wherein the three-dimensional scene data includes glTF format data and bin data; The glTF format data includes node data; Calculate the outer bounding box of the three-dimensional scene according to the node data; Based on the node data, each node is layered to obtain the layer information corresponding to each node; Divide each level into grid blocks according to the level information, associate the node with the grid, and obtain grid information corresponding to each node; Extending the glTF format data into chapters, wherein the extended chapters are used to store the level information and the grid information; Reconstructing the bin data according to the grid to obtain multiple bin data files; Rewrite the buffer data in the glTF format data based on the grid information, associate the bin data file with the glTF format data, and load the bin data file according to the buffer data based on the grid where the camera is located in the three-dimensional scene; The method of acquiring three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; and calculating an outer bounding box of the three-dimensional scene according to the node data includes: The node data is node data, each node data corresponds to a three-dimensional feature in the three-dimensional scene, and the three-dimensional feature includes a facade and a display object; Traversing the nodes data, respectively calculating the outer bounding boxes of the three-dimensional features according to the coordinate data about the three-dimensional features recorded in the accessor data block in the node data, and obtaining a first outer bounding box; Calculating an outer bounding box of the three-dimensional scene according to each of the first outer bounding boxes to obtain a second outer bounding box; After obtaining the first outer bounding box and the second outer bounding box, the nodes are layered based on the node data to obtain the layer information corresponding to each node, including: Setting layer parameters, and determining the number of layers according to the layer parameters; The projection area of ​​the corresponding three-dimensional feature is calculated according to the vertex data in the first outer bounding box. If the projection area is greater than a first threshold, the three-dimensional feature is associated with the first level; if the projection area is less than the first threshold, the three-dimensional feature is associated with the second level; the level attributes corresponding to each three-dimensional feature are obtained, and then the level information corresponding to each three-dimensional feature is obtained.

2. The three-dimensional data layering and blocking method based on the glTF data format according to claim 1, characterized in that: The calculating the projection area corresponding to the three-dimensional feature includes: Determine the extraction parameters of each three-dimensional feature, and determine the extraction level of the projection area of ​​the three-dimensional feature according to the extraction parameters, wherein the extraction level includes a general level and a fine level. If the extraction level is the general level, calculate the circumscribed rectangular area of ​​the three-dimensional feature projection according to the vertex data of the first outer bounding box of the corresponding three-dimensional feature to obtain the projection area of ​​the three-dimensional feature of the general level; If the level of the layer is refined, the contour shape area of ​​the corresponding three-dimensional feature projection is calculated to obtain the projection area of ​​the three-dimensional feature at the refined level.

3. The three-dimensional data layering and blocking method based on the glTF data format according to claim 1, characterized in that: If the projected area is greater than a first threshold, associating the three-dimensional feature with the first level; If the projected area is less than a first threshold, associating the three-dimensional feature with a second level; After that include: For the first level, the number of triangle faces of each three-dimensional feature is calculated according to the first outer bounding box to obtain the number of triangle faces of the first level; For the second level, the number of triangle faces of each three-dimensional feature is calculated according to the first outer bounding box to obtain the number of triangle faces of the second level; The difference between the number of triangular faces in the first layer and the number of triangular faces in the second layer is calculated, and the three-dimensional features at each level are balanced according to the difference, so as to obtain the level information corresponding to each updated three-dimensional feature.

4. The three-dimensional data layering and blocking method based on the glTF data format according to claim 3 is characterized in that: The grid blocks are divided into blocks for each level according to the level information, and the nodes are associated with the grids to obtain grid information corresponding to each node; including: Meshing the horizontal surface of the first level to obtain a block grid on the first level; Calculate the projection of each node in the first level on the horizontal plane of the first level to obtain a three-dimensional feature projection surface; Determining the plane intersection relationship between the three-dimensional feature projection surface and the grid; If the three-dimensional feature projection surface intersects with the grid, the node is associated with the grid intersecting with the node to obtain grid information corresponding to each node.

5. The three-dimensional data layering and blocking method based on the glTF data format according to claim 1, characterized in that: The section for extending the glTF format data, wherein the extended section is used to store the level information and the grid information, includes: The glTF format data is extended with a chapter, and the extended chapter uses a json format to store the level information and the mesh information.

6. The three-dimensional data layering and blocking method based on the glTF data format according to claim 5, characterized in that: The bin data is reconstructed according to the grid to obtain a plurality of bin data files; Rewriting the buffer data in the glTF format data based on the mesh information, and associating the bin data file with the glTF format data, including: The glTF format data also includes mesh data; Traverse the meshes data, query the corresponding data in the accessors data block through the mesh data, query the bufferViews data according to the accessor data block, read the binary data from the bin data through the bufferView data, and store all the binary data fields of the mesh into the newly created bin data file; Write back the attribute values ​​of bin, buffer, bufferView, and accessor to establish new data correspondence; In a three-dimensional scene, in response to a loading request at the camera's viewing angle, a grid at a preset distance from the corresponding grid position is loaded according to the grid position corresponding to the camera's position, and the nodes associated with the grid are displayed on the front end.

7. The three-dimensional data layering and blocking method based on the glTF data format according to claim 5, characterized in that: The bin data file is loaded according to the buffer data based on the grid where the camera is located, and then includes: Clear the bin data files outside the grid where the camera is located; The method further comprises: When loading the bin file corresponding to the grid area where the camera is located, obtain the grid projected on other levels, and asynchronously load the bin data file corresponding to the grid on other levels according to the grid on other levels.

8. A three-dimensional data layering and blocking device based on glTF data format, characterized in that: The device is used to apply the three-dimensional data layering and blocking method based on the glTF data format according to any one of claims 1 to 7, comprising: An acquisition module is used to acquire three-dimensional scene data, wherein the three-dimensional scene data includes glTF format data and bin data; the glTF format data includes node data; and an outer bounding box of the three-dimensional scene is calculated according to the node data; A stratification module, used to stratify each node based on the node data to obtain the level information corresponding to each node; A block division module is used to divide each level into grid blocks according to the level information, associate the node with the grid, and obtain the grid information corresponding to each node; An extension module, used for extending the chapter of the glTF format data, wherein the extended chapter is used for storing the level information and the grid information; An association module is used to reconstruct the bin data according to the grid to obtain multiple bin data files; rewrite the buffer data in the glTF format data based on the grid information, associate the bin data file with the glTF format data, and load the bin data file according to the buffer data based on the grid where the camera is located in the three-dimensional scene.

Citation Information

Patent Citations

  • Accelerated rendering method of scene model

    CN110910505A

  • Method and device for displaying three-dimensional data of three-dimensional scene

    CN116126440A