Model loading method and device, processing equipment and storage medium
By converting the slice enclosure box data of the 3Dtiles model into coordinates under the geographical coordinate system and performing rotation and offset processing, the problem of calculating the coordinates of the 3Dtiles model under the plane coordinate system is solved, and efficient and accurate model loading effect is achieved.
Patent Information
- Application Number
- CN202311459715.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2025-05-06
AI Technical Summary
It is difficult to efficiently and accurately calculate the coordinate positions of the three-dimensional tiles model in a planar coordinate system, resulting in large calculations and low accuracy.
By converting the slice enclosure box data of the 3Dtiles model into the reference point coordinates under the Cartesian coordinate system, it is then converted into coordinates under the geographical coordinate system. Then, the vector matrix and rotation matrix are used for the rotation operation, and finally the offset is added under the plane coordinate system to match the model coordinates.
The efficient loading of the 3Dtiles model under the plane coordinate system is realized, which improves the calculation efficiency and accuracy, better adaptability, less calculation and higher accuracy.
Smart Images

Figure CN119942008A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of three-dimensional model processing, and in particular to a 3D tiles model loading method, device, processing equipment and storage medium. Background Art
[0002] Three-dimensional models are widely used in engineering practice and other fields. Among them, 3D tiles (ThreeDimensional tiles) is a 3D model data format, which is widely used in 3D Geographic Information System (GIS) systems. It is a data format developed for stream processing and rendering of 3D geographic spatial data, such as photogrammetry, 3D buildings, and instantiated elements. In related technologies, when loading and processing 3DTiles models, they are all developed and used based on the Cesium (Cesium is a map engine for realizing 3D earth display on the browser) 3D engine geographic information system, and the coordinate system of the model is also loaded and obtained under the Cesium engine. However, it is difficult to calculate the coordinate position of 3D tiles in a plane coordinate system, resulting in large calculation amount and low accuracy. Therefore, how to efficiently and accurately load 3D tiles in a three-dimensional coordinate system into a two-dimensional coordinate system is a problem that needs to be considered. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure disclose a three-dimensional tile 3DTiles model loading method, apparatus, processing equipment and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for loading a three-dimensional tile 3DTiles model is provided, the method comprising:
[0005] Determine first coordinates of a first reference point of a bounding box based on bounding box data of a slice of a first 3D Tiles model, where the first coordinates are coordinates of the first reference point in a Cartesian coordinate system;
[0006] Converting the first coordinates of the first reference point into the second coordinates of the second reference point in the geographic coordinate system;
[0007] Determine a vector matrix based on a vector difference between a first vector and a second vector; wherein the first vector is a vector determined based on a third coordinate of a geocentric point of the geographic coordinate system; and the second vector is a vector determined based on a second coordinate of the second reference point;
[0008] Multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system;
[0009] Adding an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system;
[0010] The first 3D Tiles model is loaded in the plane coordinate system based on the coordinates of the first 3D Tiles model adapted to the plane coordinate system in the geographic coordinate system.
[0011] In one embodiment, the method further comprises:
[0012] Obtain the tile set file of the first 3D Tiles model;
[0013] Parsing the tile set file to obtain the bounding box data;
[0014] The tile set file contains the spatial range information of the slice.
[0015] In one embodiment, before multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model, the method further includes:
[0016] The vector matrix is normalized to obtain the normalized vector matrix.
[0017] In one embodiment, before multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model, the method further includes:
[0018] Performing a multiplication operation between the vector matrix and the first reference vector to obtain a quaternion;
[0019] A multiplication operation is performed between the quaternion and the second reference vector to obtain the rotation matrix.
[0020] In one embodiment, before performing the multiplication operation between the quaternion and the second reference vector to obtain the rotation matrix, the method further includes:
[0021] The quaternion is normalized to obtain the normalized quaternion.
[0022] In one embodiment, adding an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system includes at least one of the following:
[0023] Adding a first offset to the first axis coordinate of the first 3D Tiles model, where the first offset is determined based on the radius of the earth;
[0024] Adding a second offset to the second axis coordinate of the first 3D Tiles model, where the second offset is determined based on the second reference point;
[0025] A third offset is added to the third axis coordinate of the first 3D Tiles model, where the third offset is determined based on the second reference point.
[0026] In one embodiment, the method further comprises:
[0027] The loaded first 3D Tiles model is rendered in the plane coordinate system based on the three-dimensional model reference library and the coordinates of the first 3D Tiles model.
[0028] According to a second aspect of an embodiment of the present disclosure, a 3D Tiles model loading device is provided, the device comprising:
[0029] A determination module is configured to determine first coordinates of a first reference point of a bounding box based on bounding box data of a slice of a first 3D Tiles model, wherein the first coordinates are coordinates of the first reference point in a Cartesian coordinate system;
[0030] A conversion module, configured to convert a first coordinate of the first reference point into a second coordinate of a second reference point in a geographic coordinate system;
[0031] The determination module is further configured to determine a vector matrix based on a vector difference between a first vector and a second vector; wherein the first vector is a vector determined based on a third coordinate of a geocentric point of the geographic coordinate system; and the second vector is a vector determined based on a second coordinate of the second reference point;
[0032] A rotation module, configured to multiply a rotation matrix by a feature point matrix of the first 3D Tiles model to obtain a rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and a first reference vector, and the first reference vector is a reference vector on a first reference axis of the Cartesian coordinate system;
[0033] An adding module, configured to add an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system;
[0034] The loading module is configured to load the first 3D Tiles model in the plane coordinate system based on the coordinates of the first 3D Tiles model adapted to the plane coordinate system in the geographic coordinate system.
[0035] In one embodiment, the acquisition module is further configured to:
[0036] Obtain the tile set file of the first 3D Tiles model;
[0037] Parsing the tile set file to obtain the bounding box data;
[0038] The tile set file contains the spatial range information of the slice.
[0039] In one embodiment, the processing module is further configured to:
[0040] The vector matrix is normalized to obtain the normalized vector matrix.
[0041] In one embodiment, the rotation module is further configured to:
[0042] Performing a multiplication operation between the vector matrix and the first reference vector to obtain a quaternion;
[0043] A multiplication operation is performed between the quaternion and the second reference vector to obtain the rotation matrix.
[0044] In one embodiment, the rotation module is further configured to:
[0045] The quaternion is normalized to obtain the normalized quaternion.
[0046] In one embodiment, the adding module is further configured to:
[0047] Adding a first offset to the first axis coordinate of the first 3D Tiles model, where the first offset is determined based on the radius of the earth;
[0048] Adding a second offset to the second axis coordinate of the first 3D Tiles model, where the second offset is determined based on the second reference point;
[0049] A third offset is added to the third axis coordinate of the first 3D Tiles model, where the third offset is determined based on the second reference point.
[0050] In one embodiment, the loading module is further configured to:
[0051] The loaded first 3D Tiles model is rendered in the plane coordinate system based on the three-dimensional model reference library and the coordinates of the first 3D Tiles model.
[0052] According to a third aspect of an embodiment of the present disclosure, a processing device is provided, the processing device comprising:
[0053] A memory for storing executable programs;
[0054] The processor is used to implement any method described in the embodiments of the present disclosure when executing the executable program stored in the memory.
[0055] According to a fourth aspect of the embodiments of the present disclosure, a computer storage medium is provided, wherein the computer storage medium stores an executable program, and when the executable program is executed by a processor, the method described in any one of the embodiments of the present disclosure is implemented.
[0056] In the disclosed embodiment, the first coordinate of the first reference point of the bounding box is determined based on the bounding box data of the slice of the first 3D Tiles model, and the first coordinate is the coordinate of the first reference point in the Cartesian coordinate system; the first coordinate of the first reference point is converted into the second coordinate of the second reference point in the geographic coordinate system. In this way, the first coordinate of the first reference point of the bounding box of the slice of the first 3D Tiles model can be converted to the second coordinate of the second reference point in the geographic coordinate system, and the coordinate in the geographic coordinate system can be more suitable for the subsequent rotation operation of the 3D Tiles model. Based on the vector difference between the first vector and the second vector, a vector matrix is determined; wherein the first vector is a vector determined based on the third coordinate of the geocentric point of the geographic coordinate system; the second vector is a vector determined based on the second coordinate of the second reference point; the rotation matrix is multiplied with the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system. In this way, the vector matrix obtained by operation in the geographic coordinate system is determined based on the vector matrix, and the rotation matrix is used to rotate the first 3Dtiles model to obtain the rotated first 3DTiles model. The coordinates of the first 3DTiles model are added with an offset to obtain the coordinates of the first 3DTiles model adapted to the plane coordinate system. In this way, by adding an offset to the coordinates of the first 3DTiles model, the first 3Dtiles model after rotation can be adapted to the plane coordinate system. The first 3DTiles model is loaded in the plane coordinate system based on the coordinates of the first 3DTiles model adapted to the plane coordinate system in the geographic coordinate system. In this way, the loading of the first 3Dtiles model in the plane coordinate system is realized, which has better adaptability, less calculation and higher accuracy than other related methods.
[0057] BRIEF DESCRIPTION OF THE DISCLOSURE
[0058] Figure 1 is a flow chart of a 3DTiles model loading method according to an exemplary embodiment;
[0059] Figure 2 is a flow chart of a 3DTiles model loading method according to an exemplary embodiment;
[0060] Figure 3 It is a schematic structural diagram of a 3D Tiles model loading device according to an exemplary embodiment. DETAILED DESCRIPTION
[0061] In order to make the objectives, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present disclosure. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0062] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0063] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0064] In the following description, “greater than” and “less than” are involved. It should be noted that in the present disclosure, “greater than” can be used to indicate “greater than” or “equal to”; “less than” can be used to indicate “less than” or “equal to”.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the embodiments of the present disclosure and are not intended to limit the present disclosure.
[0066] like Figure 1 As shown, an embodiment of the present disclosure provides a three-dimensional tile 3DTiles model loading method, the method comprising:
[0067] Step S101, determining first coordinates of a first reference point of a bounding box based on bounding box data of a slice of a first 3D Tiles model, where the first coordinates are coordinates of the first reference point in a Cartesian coordinate system;
[0068] In one embodiment, the first 3D Tiles model may be composed of a renderable hierarchical data structure and / or a tile set.
[0069] In one embodiment, the files of the tileset may have a ".json" extension.
[0070] In one embodiment, the format type of the tile set file may be an application Multipurpose Internet Mail Extensions (MIME) type.
[0071] In one embodiment, the tile set file contains bounding volume data, wherein the bounding volume defines the spatial range of the slice.
[0072] In one embodiment, the bounding box data of the slice and / or the center point of the bounding box may be obtained by parsing the tile set file.
[0073] It should be noted that the slices in the present disclosure may also be referred to as meshes in some scenarios. In one embodiment, a tile set file of the first 3D Tiles model is obtained; the tile set file is parsed to obtain the bounding box data; wherein the tile set file contains the spatial range information of the slice.
[0074] In one embodiment, the first reference point is a point determined based on the center point of the bounding box. Exemplarily, the first reference point is the center point of the bounding box. Of course, the first reference point is not limited to the center point, but can also be a point that deviates from the center point by a predetermined value.
[0075] In one embodiment, the Cartesian coordinate system may be a geocentric coordinate system, which is a three-dimensional coordinate system. Exemplarily, the code corresponding to the geocentric coordinate system is "EPSG:4979".
[0076] Step S102, converting the first coordinates of the first reference point into the second coordinates of the second reference point in the geographic coordinate system;
[0077] In one embodiment, the geographic coordinate system is a three-dimensional coordinate system. Exemplarily, the code corresponding to the geographic coordinate system is "EPSG:4326".
[0078] In some embodiments, the first coordinates of the first reference point may be converted into the second coordinates of the second reference point in the geographic coordinate system through calculation.
[0079] Exemplarily, the first coordinate of the first reference point is (X, Y, Z), the second coordinate of the second reference point is (lon, lat, h), and the formula for calculating the second coordinate of the second reference point in the geographic coordinate system is:
[0080]
[0081]
[0082]
[0083]
[0084] in, N is the radius of the ellipsoid, a is the major radius of the earth 6378137.000 meters, b is the minor radius of the earth 6356752.314 meters, and e is the first eccentricity of the ellipsoid. X, Y, and Z represent the position of the first reference point in the Cartesian space coordinate system in the "EPSG:4979" coordinate system. lon represents the longitude value, lat represents the latitude value, and h represents the earth height (i.e., the height of the earth). In this way, the first coordinate of the first reference point of the bounding box of the slice of the first 3DTiles model can be converted to the second coordinate of the second reference point in the geographic coordinate system, and the coordinates in the geographic coordinate system can be more suitable for subsequent rotation operations on the 3DTiles model.
[0085] Step S103, determining a vector matrix based on a vector difference between the first vector and the second vector; wherein the first vector is a vector determined based on a third coordinate of the geocentric point of the geographic coordinate system; and the second vector is a vector determined based on a second coordinate of the second reference point;
[0086] In one embodiment, the third coordinate of the geocentric point in the geographic coordinate system is obtained, for example, the third coordinate is (0,0,0); the second coordinate of the second reference point in the geographic coordinate system is obtained, for example, the second coordinate is (lon, lat, h).
[0087] In some embodiments, the second coordinate and the third coordinate are vectorized, wherein the first vector is a vector determined based on the third coordinate of the geocentric point of the geographic coordinate system; the second vector is a vector determined based on the second coordinate of the second reference point. A vector difference between the first vector and the second vector is obtained.
[0088] In some embodiments, a vector matrix is determined based on the vector difference. Exemplarily, the vector matrix is a matrix V (x, y, z) obtained by matrixing the vector difference.
[0089] In some embodiments, before multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model, it also includes: normalizing the vector matrix to obtain the normalized vector matrix.
[0090] In some embodiments, the vector matrix V (x, y, z) may be normalized (the normalized matrix may simplify calculations, and in some scenarios, V may not be normalized, which is not limited here). The normalized vector matrix may be:
[0091]
[0092] It should be noted that in order to simplify the formula, No more details.
[0093] Step S104, multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system;
[0094] In some embodiments, a multiplication operation is performed between the vector matrix and the first reference vector to obtain a quaternion; a multiplication operation is performed between the quaternion and the second reference vector to obtain the rotation matrix; and the first 3D Tiles model after rotation is obtained by multiplying the rotation matrix with the feature point matrix of the first 3D Tiles model.
[0095] In one embodiment, the first reference vector may be a pre-set reference vector on the first reference axis of the Cartesian coordinate system. For example, the first reference vector may be Z=[x2 y2 z2].
[0096] In one embodiment, the first reference axis may be the z-axis.
[0097] In one embodiment, the vector matrix is multiplied by the first reference vector to obtain a rotation matrix, illustratively:
[0098]
[0099] Z = [x2 y2 z2];
[0100] q=(1+x1x2+y1y2+z1z2)+(y1z2-z1y2)i+(z1x2-x1z2)j+(x1y2-y1x2)k;
[0101] q is a quaternion.
[0102] In some embodiments, before performing the multiplication operation between the quaternion and the second reference vector to obtain the rotation matrix, it also includes: normalizing the quaternion to obtain the normalized quaternion.
[0103] In one embodiment, the quaternion may be normalized before being applied (for convenience of calculation), and the normalized q is:
[0104]
[0105] In one embodiment, based on the quaternion and the rotation parameters, a rotation matrix can be determined. Exemplarily, the rotation matrix is:
[0106]
[0107] In one embodiment, the rotated first 3D Tiles model can be obtained by multiplying Rq with the coordinates of the first 3D Tiles model. In this way, the first 3D Tiles model is rotated using the rotation matrix by obtaining a vector matrix through operation in the geographic coordinate system and determining a rotation matrix based on the vector matrix to obtain the rotated first 3D Tiles model.
[0108] Step S105, adding an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system;
[0109] In one embodiment, a first offset is added to the first axis coordinate of the first 3D Tiles model, and the first offset is determined based on the radius of the earth. Exemplarily, the first offset is the radius of the earth.
[0110] In one embodiment, a second offset is added to the second axis coordinate of the first 3D Tiles model, and the second offset is determined based on the second reference point.
[0111] In one embodiment, a third offset is added to the third axis coordinate of the first 3D Tiles model, and the third offset is determined based on the second reference point.
[0112] Step S106: loading the first 3D Tiles model in the plane coordinate system based on the coordinates of the first 3D Tiles model adapted to the plane coordinate system in the geographic coordinate system.
[0113] In one embodiment, the loaded first 3D Tiles model is rendered in the plane coordinate system based on the three-dimensional model reference library and the coordinates of the first 3D Tiles model.
[0114] In this way, the loading of the first 3D tiles model in the plane coordinate system is realized, which has better adaptability, less calculation and higher accuracy compared with other related methods.
[0115] In some embodiments, a tile set file of a first 3D Tiles model is obtained. The tile set file is parsed to obtain bounding box data; wherein the tile set file contains spatial range information of the slice. A first coordinate of a first reference point of the bounding box is determined based on the bounding box data, wherein the first coordinate is the coordinate of the first reference point in a Cartesian coordinate system. The first coordinate of the first reference point is converted into a second coordinate of a second reference point in a geographic coordinate system. A vector matrix is determined based on a vector difference between a first vector and a second vector; wherein the first vector is a vector determined based on a third coordinate of a geocentric point in the geographic coordinate system; and the second vector is a vector determined based on a second coordinate of the second reference point. A rotation matrix is multiplied by a feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, wherein the first reference vector is a reference vector on a first reference axis of the Cartesian coordinate system. An offset is added to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to a plane coordinate system. The first 3D Tiles model is loaded in the plane coordinate system based on the coordinates of the first 3D Tiles model.
[0116] In some embodiments, the first coordinate of the first reference point of the bounding box is determined based on the bounding box data of the slice of the first 3D Tiles model, and the first coordinate is the coordinate of the first reference point in the Cartesian coordinate system. The first coordinate of the first reference point is converted into the second coordinate of the second reference point in the geographic coordinate system. Based on the vector difference between the first vector and the second vector, a vector matrix is determined; wherein the first vector is a vector determined based on the third coordinate of the geocentric point of the geographic coordinate system; and the second vector is a vector determined based on the second coordinate of the second reference point. The vector matrix is normalized to obtain the normalized vector matrix. The rotation matrix is multiplied by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system. The coordinates of the first 3D Tiles model are added with an offset to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system. The first 3D Tiles model is loaded in the plane coordinate system based on the coordinates of the first 3D Tiles model.
[0117] In some embodiments, the first coordinate of the first reference point of the bounding box is determined based on the bounding box data of the slice of the first 3D Tiles model, and the first coordinate is the coordinate of the first reference point in the Cartesian coordinate system. The first coordinate of the first reference point is converted into the second coordinate of the second reference point in the geographic coordinate system. Based on the vector difference between the first vector and the second vector, a vector matrix is determined; wherein the first vector is a vector determined based on the third coordinate of the geocentric point of the geographic coordinate system; and the second vector is a vector determined based on the second coordinate of the second reference point. A multiplication operation is performed between the vector matrix and the first reference vector to obtain a quaternion; the quaternion is normalized to obtain the normalized quaternion; a multiplication operation is performed between the quaternion and the second reference vector to obtain the rotation matrix; and the first 3D Tiles model is rotated based on the rotation matrix and the feature point matrix of the first 3D Tiles model. An offset is added to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system. The first 3D Tiles model is loaded in the plane coordinate system based on the coordinates of the first 3D Tiles model.
[0118] In some embodiments, the first coordinates of the first reference point of the bounding box are determined based on the bounding box data of the slice of the first 3D Tiles model, and the first coordinates are the coordinates of the first reference point in the Cartesian coordinate system. The first coordinates of the first reference point are converted into the second coordinates of the second reference point in the geographic coordinate system. Based on the vector difference between the first vector and the second vector, a vector matrix is determined; wherein the first vector is a vector determined based on the third coordinates of the geocentric point of the geographic coordinate system; and the second vector is a vector determined based on the second coordinates of the second reference point. The rotation matrix is multiplied by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system. Add a first offset to the first axis coordinate of the first 3DTiles model, the first offset is determined based on the radius of the earth; and / or add a second offset to the second axis coordinate of the first 3DTiles model, the second offset is determined based on the second reference point; and / or add a third offset to the third axis coordinate of the first 3DTiles model, the third offset is determined based on the second reference point; obtain the coordinates of the first 3DTiles model adapted to the plane coordinate system. Load the first 3DTiles model in the plane coordinate system based on the coordinates of the first 3DTiles model.
[0119] The present disclosure The present disclosure
[0120] In order to better understand the embodiments of the present disclosure, the technical solution of the present disclosure is further described below through an exemplary embodiment:
[0121] See also Figure 2 , showing the use of the disclosed embodiment to load a 3DTiles model. Figure 2 , the loading methods include:
[0122] Step S201, use the Three.js library to build a coordinate system and render a base map; here, the Three.js library is a three-dimensional model reference library.
[0123] Step S202: Obtain the tileset.json file in the 3Dtiles data root directory through the preloaded 3Dtiles file (corresponding to the first 3DTiles model);
[0124] Step S203, parse the tileset.json file to obtain relevant information such as transform (calculate the model bounding box);
[0125] Step S204, taking the 12th, 13th and 14th bits of transform as the spherical coordinates of the latitude, longitude and altitude of the center point of the current 3D tiles model (the coordinates of the first reference point (X, Y, Z));
[0126] Step S205, converting the spherical coordinates of the model into plane coordinates;
[0127] In one embodiment, a wgs84OneOverRadii (here, wgs84OneOverRadii is an identifier for defining a three-dimensional vector, other identifiers may also be used, which are not limited here) three-dimensional vector and a wgs84OneOverRadiiSquared (here, wgs84OneOverRadiiSquared is an identifier for defining a three-dimensional vector, other identifiers may also be used, which are not limited here) three-dimensional vector are customized, a three-dimensional vector is instantiated according to the center point of the model, the center point is processed with coordinates, and an x value is defined as the square of the x of the center point three-dimensional vector multiplied by the square of the x of the wgs84OneOverRadii three-dimensional vector;
[0128] Define a y value as the square of the y value of the three-dimensional vector of the center point multiplied by the square of the y value of the three-dimensional vector of wgs84OneOverRadii;
[0129] Define a z value as the square of the z of the three-dimensional vector of the center point multiplied by the square of the z of the three-dimensional vector of wgs84OneOverRadii;
[0130] Define a square ellipsoid norm equal to the value of the square root of (x+y+z), multiply the three-dimensional vector by the norm to obtain the projection point information, and finally return the three-dimensional vector.
[0131] Step S206: coordinate conversion operation: normalize the above three-dimensional vectors according to l Calculate the longitude coordinates according to Calculate the latitude coordinates, calculate the height coordinates according to h = p / (cos(lat))-N, encapsulate the obtained latitude and longitude height values into a point coordinate and convert it into the coordinates in the geographic coordinate system (the corresponding code is WGS84), which can be (lon, lat, h);
[0132] Step S207, obtain the vector matrix; obtain the coordinates of the center point (0, 0, 0) and the above center point, through the formula
[0133]
[0134]
[0135]
[0136] Calculate and vectorize to obtain a new vector matrix V(x, y, z);
[0137] It should be noted that in order to simplify the formula,
[0138] Step S208, perform a rotation operation; a mixed operation (including a multiplication operation) between the vector v and the z axis z (0, 0, 1) x = vy*zz-vz*zy, y = vz*zx-vx*zz, z = vz*zy-vy*zx, according to the formula:
[0139] q=(1+x1x2+y1y2+z1z2)+(y1z2-z1y2)i+(z1x2-x1z2)j+(x1y2-y1x2)k
[0140] The quaternion is calculated. Continue to use the formula for the quaternion:
[0141]
[0142] The calculation is normalized. Finally, the normalized quaternion is rotated, the rotation matrix is calculated, and the matrix is applied to the model. This step is to move the model from the real position of the earth to the North Pole.
[0143] Step S209, perform an offset operation; add an offset of the negative earth radius length (corresponding to the first offset) to the z value of the model, and move the model from the North Pole to the center of the earth. Add offsets to the x and y values of the model (corresponding to the second and third offsets). Finally, the coordinates of the three-dimensional model are obtained, and the plane coordinate system is adapted;
[0144] Step S210, loading the model; using the Three.JS library to complete the 3D Tiles model rendering according to the calculated coordinates.
[0145] like Figure 3 As shown, an embodiment of the present disclosure provides a 3D Tiles model loading device, the device comprising:
[0146] A determination module 31 is configured to determine first coordinates of a first reference point of a bounding box based on bounding box data of a slice of a first 3D Tiles model, wherein the first coordinates are coordinates of the first reference point in a Cartesian coordinate system;
[0147] A conversion module 32, configured to convert the first coordinates of the first reference point into second coordinates of a second reference point in a geographic coordinate system;
[0148] The processing module 33 is configured to determine a vector matrix based on a vector difference between a first vector and a second vector; wherein the first vector is a vector determined based on a third coordinate of a geocentric point of the geographic coordinate system; and the second vector is a vector determined based on a second coordinate of the second reference point;
[0149] The rotation module 34 is configured to multiply the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system;
[0150] An adding module 35 is configured to add an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system;
[0151] The loading module 36 is configured to load the first 3D Tiles model in the plane coordinate system based on the coordinates of the first 3D Tiles model adapted to the plane coordinate system in the geographic coordinate system.
[0152] In one embodiment, the acquisition module 31 is further configured to:
[0153] Obtain the tile set file of the first 3D Tiles model;
[0154] Parsing the tile set file to obtain the bounding box data;
[0155] The tile set file contains the spatial range information of the slice.
[0156] In one embodiment, the processing module 33 is further configured to:
[0157] The vector matrix is normalized to obtain the normalized vector matrix.
[0158] In one embodiment, the rotation module 34 is further configured to:
[0159] Performing a multiplication operation between the vector matrix and the first reference vector to obtain a quaternion;
[0160] Performing a multiplication operation between the quaternion and a second reference vector to obtain the rotation matrix;
[0161] The first 3D Tiles model after rotation is obtained by multiplying the rotation matrix with the feature point matrix of the first 3D Tiles model.
[0162] In one embodiment, the rotation module 34 is further configured to:
[0163] The quaternion is normalized to obtain the normalized quaternion.
[0164] In one embodiment, the adding module 35 is further configured to:
[0165] Adding a first offset to the first axis coordinate of the first 3D Tiles model, where the first offset is determined based on the radius of the earth;
[0166] Adding a second offset to the second axis coordinate of the first 3D Tiles model, where the second offset is determined based on the second reference point;
[0167] A third offset is added to the third axis coordinate of the first 3D Tiles model, where the third offset is determined based on the second reference point.
[0168] In one embodiment, the loading module 36 is further configured to:
[0169] The loaded first 3D Tiles model is rendered in the plane coordinate system based on the three-dimensional model reference library and the coordinates of the first 3D Tiles model.
[0170] The present disclosure provides a processing device, the processing device comprising:
[0171] A memory for storing executable programs;
[0172] The processor is used to implement any method described in the embodiments of the present disclosure when executing the executable program stored in the memory.
[0173] It can be understood that the memory can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present disclosure are intended to include, but are not limited to, these and any other suitable types of memories.
[0174] Among them, the method disclosed in the present disclosure can be applied to the processor or implemented by the processor. The processor can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the method for determining the topological structure can be completed by an integrated logic circuit of the hardware in the processor or an instruction in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps and logic block diagrams disclosed in the present disclosure. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the present disclosure, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory, and completes the steps of the method for determining the topological structure provided in the embodiment of the present disclosure in combination with its hardware.
[0175] The present disclosure also provides a computer storage medium, wherein the computer storage medium stores an executable program, and when the executable program is executed by a processor, the method for determining the topological structure as described in any of the embodiments of the present disclosure is implemented. Specifically, it can be a computer-readable storage medium, such as a memory that stores a computer program, and the above-mentioned computer program can be executed by a processor of a processing device to complete the steps described in the method of the embodiment of the present disclosure. The computer-readable storage medium can be a memory such as ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.
[0176] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A three-dimensional tile 3DTiles model loading method, characterized in that: The method comprises: Determine first coordinates of a first reference point of a bounding box based on bounding box data of a slice of a first 3D Tiles model, where the first coordinates are coordinates of the first reference point in a Cartesian coordinate system; Converting the first coordinate of the first reference point into a second coordinate of a second reference point in a geographic coordinate system; Determine a vector matrix based on a vector difference between a first vector and a second vector; wherein the first vector is a vector determined based on a third coordinate of a geocentric point of the geographic coordinate system; and the second vector is a vector determined based on the second coordinate; Multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and the first reference vector, and the first reference vector is a reference vector on the first reference axis of the Cartesian coordinate system; Adding an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system; The first 3D Tiles model is loaded in the plane coordinate system based on the coordinates adapted to the plane coordinate system in the geographic coordinate system.
2. The method according to claim 1, characterized in that: The method further comprises: Obtain the tile set file of the first 3D Tiles model; Parsing the tile set file to obtain the bounding box data; The tile set file contains the spatial range information of the slice.
3. The method according to claim 1, characterized in that Before multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model, the method further includes: The vector matrix is normalized to obtain the normalized vector matrix.
4. The method according to claim 1, characterized in that: Before multiplying the rotation matrix by the feature point matrix of the first 3D Tiles model to obtain the rotated first 3D Tiles model, the method further includes: Performing a multiplication operation between the vector matrix and the first reference vector to obtain a quaternion; A multiplication operation is performed between the quaternion and the second reference vector to obtain the rotation matrix.
5. The method according to claim 4, characterized in that Before performing the multiplication operation between the quaternion and the second reference vector to obtain the rotation matrix, the method further includes: The quaternion is normalized to obtain the normalized quaternion.
6. The method according to claim 1, characterized in that The step of adding an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system includes at least one of the following: Adding a first offset to the first axis coordinate of the first 3D Tiles model, where the first offset is determined based on the radius of the earth; Adding a second offset to the second axis coordinate of the first 3D Tiles model, where the second offset is determined based on the second reference point; A third offset is added to the third axis coordinate of the first 3D Tiles model, where the third offset is determined based on the second reference point.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The loaded first 3D Tiles model is rendered in the plane coordinate system based on the three-dimensional model reference library and the coordinates of the first 3D Tiles model.
8. A 3D Tiles model loading device, characterized in that: The device comprises: A determination module is configured to determine first coordinates of a first reference point of a bounding box based on bounding box data of a slice of a first 3D Tiles model, wherein the first coordinates are coordinates of the first reference point in a Cartesian coordinate system; A conversion module, configured to convert a first coordinate of the first reference point into a second coordinate of a second reference point in a geographic coordinate system; A processing module, configured to determine a vector matrix based on a vector difference between a first vector and the second vector; wherein the first vector is a vector determined based on a third coordinate of a geocentric point of the geographic coordinate system; and the second vector is a vector determined based on a second coordinate of the second reference point; A rotation module, configured to multiply a rotation matrix by a feature point matrix of the first 3D Tiles model to obtain a rotated first 3D Tiles model; wherein the rotation matrix is a matrix determined based on the multiplication of the vector matrix and a first reference vector, and the first reference vector is a reference vector on a first reference axis of the Cartesian coordinate system; An adding module, configured to add an offset to the coordinates of the first 3D Tiles model to obtain the coordinates of the first 3D Tiles model adapted to the plane coordinate system; The loading module is configured to load the first 3D Tiles model in the plane coordinate system based on the coordinates of the first 3D Tiles model adapted to the plane coordinate system in the geographic coordinate system.
9. A processing device, characterized in that: The processing equipment comprises: A memory for storing executable programs; A processor, configured to implement the method according to any one of claims 1 to 7 when executing the executable program stored in the memory.
10. A computer storage medium, characterized in that: The computer storage medium stores an executable program, and when the executable program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.