Cesium-based 3DGS model loading method, device and equipment

By directly loading 3DGS models in Ply or Splat format on the Cesium platform and combining the advantages of Cesium and Three.js, the technical difficulties of loading and rendering complex models are solved, efficient data processing and rendering optimization are achieved, and data accuracy and system stability are ensured.

CN120655874AActive Publication Date: 2025-09-16MOBILE BROADCASTING & INFORMATION SERVICE IND INNOVATION RES INST (WUHAN) CO LTD

Patent Information

Application Number
CN202510548973.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-09-16
Estimated Expiration
2045-04-28

Smart Images

  • Figure CN120655874A_ABST
    Figure CN120655874A_ABST
Patent Text Reader

Abstract

The invention provides a Cesium-based 3DGS model loading method, device and equipment, and relates to the field of 3D model processing, and the method comprises the steps: introducing a Cesium library, creating a Cesium three-dimensional earth and superposing a sky map base map, introducing Three.js to create a renderer, a Three.js scene and a lens, and setting the original point of the Three.js scene as the central point of the Cesium three-dimensional earth; the method comprises the following steps: acquiring to-be-loaded 3DGS model data, analyzing vertex data of the to-be-loaded 3DGS model data, generating point cloud data through a Gaussian distribution algorithm, creating a geometry and a material based on the point cloud data, forming a Mesh object, and adding the Mesh object to a Three.js scene to obtain a loaded model; mapping the loaded model from a Cesium coordinate system to a Three.js coordinate system, and dynamically adjusting the position and direction of the camera to obtain a rendered model; and processing the rendered model to obtain an optimized model. According to the method, the 3DGS model does not need to be converted into the 3DTiles format in advance, so that the working process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of 3D model processing, and in particular to a Cesium-based 3DGS model loading method, device and equipment. Background Art

[0002] With the acceleration of urbanization, modern cities are rapidly moving towards digitalization and informatization. As a key achievement in urban informatization, digital 3D cities use digital means to accurately model and present a city's geographic information, buildings, and facilities in three dimensions. This provides intuitive and accurate decision-making for city planners, real-time, dynamic city operation monitoring data for city managers, and rich, convenient city information services for citizens. The construction of digital 3D cities requires processing and displaying large amounts of complex 3D model data. 3DGS models, due to their ability to highly reproduce urban geographic scenes, have become a crucial data source for digital 3D city construction. However, directly loading 3DGS models on the Cesium platform presents certain technical challenges.

[0003] As a powerful geospatial data processing and visualization tool, the Cesium library has excellent geographic data compatibility and terrain rendering capabilities. Its built-in terrain rendering engine can efficiently process large-scale terrain data and dynamically adjust the terrain accuracy based on the distance between the user's perspective and the terrain through level of detail (LOD) technology, thereby greatly improving rendering efficiency while ensuring visual effects. However, Cesium has certain limitations when processing complex three-dimensional model files, especially formats that are not natively supported by itself (such as the Ply or Splat formats of 3DGS models). On the other hand, Three.js, as a library focused on 3D graphics rendering and interaction, performs well in processing the rendering of complex 3D models. However, Three.js lacks the geospatial data processing capabilities of Cesium, making it difficult to directly provide accurate geographic positioning and terrain matching for 3D models.

[0004] Currently, loading 3DGS models in Cesium typically requires pre-converting them to the Cesium-supported 3DTiles format using GISBox or other file format conversion software. This process is not only cumbersome and increases project processing time and effort, but can also lead to data loss and precision loss during the format conversion process, impacting the final 3D scene's visual quality and data accuracy. Frequent format conversions also reduce project maintainability and scalability. Compatibility differences between different conversion software can lead to instability or even failure when dealing with large amounts of data or complex model structures. Furthermore, existing technologies often lack effective memory management and rendering optimization for loading and rendering large-scale 3D models. With increasing model complexity and changing viewpoints, rendering performance and memory usage become critical constraints. In particular, when combining Cesium with Three.js, effectively leveraging their strengths to accurately process geospatial data and render complex 3D models while ensuring system stability and performance remains a pressing technical challenge. However, there is currently no technical solution that can solve the above technical problems, and there is no 3DGS model loading method, device and equipment based on Cesium. Summary of the Invention

[0005] The present invention provides a Cesium-based 3DGS model loading method, device, and equipment, proposing a new solution to simplify workflow, improve data processing efficiency, ensure data integrity and accuracy, and optimize rendering performance and memory usage, thereby achieving the goal of directly loading 3DGS models in the Cesium platform.

[0006] In a first aspect, the present invention provides a 3DGS model loading method based on Cesium, comprising:

[0007] Import the Cesium library, create a Cesium 3D globe and overlay the Tiantu map basemap, import Three.js to create a renderer, Three.js scene, and camera, and set the Three.js scene origin to the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves;

[0008] Obtaining the 3DGS model data to be loaded from a preset server, parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data using a Gaussian distribution algorithm, creating geometric bodies and materials based on the point cloud data, and adding them to the Three.js scene after forming a Mesh object to obtain the loaded model;

[0009] Mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjusting the camera position and direction to obtain a rendered model;

[0010] Processing the rendered model by a preset frustum clipping method to obtain an optimized model;

[0011] The loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted into 3DTiles format during the loading process.

[0012] According to the Cesium-based 3DGS model loading method provided by the present invention, the introduction of Three.js to create a renderer, a Three.js scene, and a lens includes:

[0013] Import Three.js, create a renderer, set anti-aliasing parameters and resolution parameters, and create a Three.js scene to accommodate three-dimensional objects;

[0014] Create a lens, set the initial far clipping plane value to 1000, and set the initial near clipping plane value to 1;

[0015] When the camera perspective or scene content changes, the far clipping plane value and the near clipping plane value are dynamically adjusted according to the preset formula.

[0016] According to the Cesium-based 3DGS model loading method provided by the present invention, the dynamic adjustment of the far clipping plane value and the near clipping plane value according to the preset formula includes:

[0017] Determining a first weighted value according to a product of a precision coefficient and a camera height;

[0018] Determining a second weighted value according to the product of the model complexity coefficient and the model complexity;

[0019] Determine a first weight value according to the product of the first weight value and a first weight coefficient, determine a second weight value according to the product of the second weight value and a second weight coefficient, and determine a clipping surface value according to the sum of the first weight value and the second weight value;

[0020] The clipping plane value includes a far clipping plane value and a near clipping plane value.

[0021] According to the Cesium-based 3DGS model loading method provided by the present invention, before or after dynamically adjusting the far clipping plane value and the near clipping plane value according to the preset formula, the preset geographic lighting unified algorithm is used to synchronize the Cesium sun azimuth angle and the Three.js parallel light direction, specifically including:

[0022] Calculate the sun azimuth angle based on the Cesium sun azimuth angle parameter, and map the sun azimuth angle to the Three.js parallel light parameter to synchronize the Cesium sun azimuth angle with the Three.js parallel light direction.

[0023] According to the Cesium-based 3DGS model loading method provided by the present invention, parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data through a Gaussian distribution algorithm includes:

[0024] Parsing vertex data of the 3DGS model data to be loaded, wherein the vertex data includes vertex coordinates, vertex colors, and normal attributes;

[0025] For each vertex, a Gaussian distribution parameter is generated by a Gaussian distribution algorithm, and the point cloud data is created according to the Gaussian distribution parameter.

[0026] According to the Cesium-based 3DGS model loading method provided by the present invention, after parsing the vertex data of the 3DGS model data to be loaded, the Gaussian distribution radius is dynamically adjusted according to the vertex density;

[0027] The dynamic adjustment of the vertex density of the Gaussian distribution radius includes:

[0028] When the vertex density is greater than a preset density threshold, reducing the Gaussian distribution radius to improve model accuracy;

[0029] When the vertex density is less than or equal to the preset density threshold, the Gaussian distribution radius is enlarged to reduce rendering load.

[0030] According to the Cesium-based 3DGS model loading method provided by the present invention, the loaded model is mapped from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, including:

[0031] Calculate the rotation quaternion according to the latitude and longitude, altitude and rotation parameters of the loaded model;

[0032] The loaded model is synchronized from the Cesium coordinate system to the Three.js right-handed coordinate system using the rotation quaternion.

[0033] According to the Cesium-based 3DGS model loading method provided by the present invention, the rendered model is processed by a preset frustum clipping method to obtain an optimized model, including:

[0034] Constructing a dynamic bounding box according to the rendered model, calculating the intersection of the dynamic bounding box and the viewing cone according to the camera viewing angle, determining the intersection portion, and rendering the intersection portion;

[0035] Establish a memory pool management model memory block and reclaim the memory block with a reference count of zero through the reference counting mechanism.

[0036] In the second aspect, a Cesium-based 3DGS model loading device is provided, comprising:

[0037] An initialization unit, which is used to import the Cesium library, create a Cesium 3D globe and overlay a Tiantu map basemap, import Three.js to create a renderer, a Three.js scene, and a camera, and set the Three.js scene origin to the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves;

[0038] A loading unit, configured to obtain 3DGS model data to be loaded from a preset server, parse vertex data of the 3DGS model data to be loaded, generate point cloud data using a Gaussian distribution algorithm, create geometric bodies and materials based on the point cloud data, and add the resulting mesh objects to the Three.js scene to obtain a loaded model;

[0039] A rendering unit, configured to map the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjust the camera position and direction, and obtain a rendered model;

[0040] an optimization unit, configured to process the rendered model using a preset frustum clipping method to obtain an optimized model;

[0041] The loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted into 3DTiles format during the loading process.

[0042] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the Cesium-based 3DGS model loading method when executing the program.

[0043] The present invention proposes a loading method without file type conversion, which directly loads 3DGS models in the Cesium platform without the need to pre-convert the 3DGS model into the 3DTiles format with the help of GISBox or other file format conversion software. This method greatly simplifies the workflow, shortens project processing time, and improves work efficiency. By introducing the Cesium library and the Three.js library and cleverly combining the two, the rapid processing of geospatial data and the fine rendering of complex 3D models are achieved. Cesium is responsible for providing accurate geographic positioning and terrain matching, while Three.js focuses on the rendering and interaction of 3D graphics. The two work together to significantly improve data processing efficiency. Since the tedious format conversion process is avoided, the present invention effectively reduces problems such as data loss and precision loss caused by format conversion, which ensures the final three-dimensional scene display effect and data accuracy, and provides more reliable basic data support for urban planning, management and citizen services. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 This is one of the flow charts of the Cesium-based 3DGS model loading method provided by the present invention;

[0046] Figure 2 This is the second flow chart of the Cesium-based 3DGS model loading method provided by the present invention;

[0047] Figure 3 This is the rendering of the Cesium loaded 3DGS model provided by the present invention;

[0048] Figure 4 It is a structural diagram of the Cesium-based 3DGS model loading device provided by the present invention;

[0049] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0050] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0051] Combining Cesium and Three.js to load 3DGS models can fully leverage the advantages of both. Cesium's geospatial processing capabilities can provide accurate geographic positioning and terrain matching for 3DGS models, while Three.js can perform fine rendering and interactive control of 3DGS models, improving the model's visual effects and user experience. Figure 1 This is one of the flow charts of the Cesium-based 3DGS model loading method provided by the present invention, and the Cesium-based 3DGS model loading method includes:

[0052] Step 101: Import the Cesium library, create a Cesium 3D globe and overlay the Tiantu map base map, import Three.js to create a renderer, a Three.js scene, and a lens, and set the Three.js scene origin to the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves;

[0053] Step 102: Obtain the 3DGS model data to be loaded from the preset server, parse the vertex data of the 3DGS model data to be loaded, generate point cloud data using a Gaussian distribution algorithm, create geometric bodies and materials based on the point cloud data, and add them to the Three.js scene after forming a Mesh object to obtain the loaded model;

[0054] Step 103: Map the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjust the camera position and direction, and obtain a rendered model;

[0055] Step 104: Process the rendered model using a preset frustum clipping method to obtain an optimized model;

[0056] The loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted into 3DTiles format during the loading process.

[0057] In step 101, the Cesium.js library and related dependencies are introduced into the project to ensure that the Cesium environment can operate normally. Through the initial configuration of Cesium, a Cesium 3D Earth object is created and necessary parameters such as the Earth's surface texture and lighting effects are set. Image data from Tiandi Map is requested and overlaid on the Cesium 3D Earth as a map basemap to make the Earth scene richer and more realistic.

[0058] Optionally, the introduction of Three.js to create a renderer, a Three.js scene, and a lens includes:

[0059] Import Three.js, create a renderer, set anti-aliasing parameters and resolution parameters, and create a Three.js scene to accommodate three-dimensional objects;

[0060] Create a lens, set the initial far clipping plane value to 1000, and set the initial near clipping plane value to 1;

[0061] When the camera perspective or scene content changes, the far clipping plane value and the near clipping plane value are dynamically adjusted according to the preset formula.

[0062] Optionally, include the Three.js library in your project and create a renderer object. The renderer handles scene information like lighting, materials, and textures, and outputs them to the screen. Set renderer parameters, such as anti-aliasing and resolution, to improve rendering quality. Create a Three.js scene to house your 3D objects and a lens object to determine the camera's viewing angle and field of view. Set the lens's initial far clipping plane to 1000 and its near clipping plane to 1. These values ​​will be adjusted dynamically based on the scene's content.

[0063] When the camera perspective or scene content changes, the far and near clipping plane parameters are dynamically modified to maintain normal rendering of the model. Reasonable settings of the far and near clipping planes can avoid unnecessary rendering calculations and improve rendering efficiency. The dynamic adjustment of the far and near clipping plane values ​​according to the preset formula includes:

[0064] Determining a first weighted value according to a product of a precision coefficient and a camera height;

[0065] Determining a second weighted value according to the product of the model complexity coefficient and the model complexity;

[0066] Determine a first weight value according to the product of the first weight value and a first weight coefficient, determine a second weight value according to the product of the second weight value and a second weight coefficient, and determine a clipping surface value according to the sum of the first weight value and the second weight value;

[0067] The clipping plane value includes a far clipping plane value and a near clipping plane value.

[0068] Optionally, the formula for calculating the near and far clipping planes is as follows:

[0069] m=(k*d)*0.7+(c*t)*0.3

[0070] Among them, k is the precision coefficient, which changes with the camera height, d is the camera height, c is the model complexity coefficient, which changes with the model complexity, and t is the model complexity.

[0071] Optionally, set the origin of the Three.js scene to the center of the Cesium 3D globe, linking the Cesium globe and the Three.js scene. This allows the Cesium 3D globe's perspective to move synchronously with the Three.js scene's movement, achieving perspective synchronization when the scene moves. When linking the Cesium globe and the Three.js scene, set the Three.js scene origin to the center of the Cesium globe, establishing a connection between the two different coordinate systems. This allows the Cesium globe's perspective to move synchronously with the Three.js scene's movement. Furthermore, integrating a unified geographic lighting algorithm improves the realism of 3D models and the physical consistency of scenes while ensuring geographic accuracy. Both Cesium and Three.js perform geographic lighting processing, avoiding issues like shadow distortion and anti-aliasing.

[0072] Optionally, before or after dynamically adjusting the far and near clipping plane values ​​according to a preset formula, synchronize the Cesium sun azimuth with the Three.js parallel light direction using a preset unified geographic lighting algorithm, specifically including:

[0073] Calculate the sun azimuth angle based on the Cesium sun azimuth angle parameter, and map the sun azimuth angle to the Three.js parallel light parameter to synchronize the Cesium sun azimuth angle with the Three.js parallel light direction.

[0074] Optionally, the solar azimuth angle calculation formula in Cesium is:

[0075]

[0076] Among them, α is the hour angle, δ is the solar declination angle, and φ is the latitude of the observation point.

[0077] The calculation formula for Three.js parallel light direction mapping is:

[0078]

[0079] Where θ is the solar azimuth angle and R is the axis-aligned matrix.

[0080] In step 102, according to a given model address, model data is obtained from a server through a network request. The vertex data of the 3DGS model data to be loaded is parsed and point cloud data is generated using a Gaussian distribution algorithm, including:

[0081] Parsing vertex data of the 3DGS model data to be loaded, wherein the vertex data includes vertex coordinates, vertex colors, and normal attributes;

[0082] For each vertex, a Gaussian distribution parameter is generated by a Gaussian distribution algorithm, and the point cloud data is created according to the Gaussian distribution parameter.

[0083] Optionally, the model file contains attribute information such as vertex coordinates, colors, and normals. Each vertex data parsed from the file will be processed through Gaussian Splatting technology to generate a suitable Gaussian distribution for each vertex. This process will accurately use Gaussian distribution to represent the position and appearance characteristics of the point in three-dimensional space. The probability density function of Gaussian distribution is:

[0084]

[0085] Among them, μ is the mean vector representing the center position of the Gaussian distribution, ∑ is the covariance matrix, and x-μ means centering the data distribution.

[0086] Next, create a Mesh object and add it to the scene. Based on the Gaussian point cloud data, create a geometry object that meets Three.js requirements. To achieve a more realistic effect, create a standard lighting material for the geometry. Combine the created geometry and material into a Mesh object. Add the Mesh object to the Three.js scene, and the model will be displayed in the scene.

[0087] Optionally, after parsing the vertex data of the 3DGS model data to be loaded, dynamically adjusting the Gaussian distribution radius according to the vertex density;

[0088] The dynamic adjustment of the vertex density of the Gaussian distribution radius includes:

[0089] When the vertex density is greater than a preset density threshold, reducing the Gaussian distribution radius to improve model accuracy;

[0090] When the vertex density is less than or equal to the preset density threshold, the Gaussian distribution radius is enlarged to reduce rendering load.

[0091] First, the vertex data of the 3DGS model data to be loaded is parsed according to the conventional process, including information such as vertex coordinates, vertex colors, and normal attributes. A reasonable spatial range is determined, and the number of vertices within the spatial range is counted. The vertex density is calculated based on the size of the spatial range and the number of vertices. Based on experience or experimental data, a reasonable preset density threshold is set. This threshold is used to distinguish different complexity areas of the model, thereby determining the adjustment direction of the Gaussian distribution radius. When the vertex density is greater than the preset density threshold, the Gaussian distribution radius is reduced. By reducing the coverage of the Gaussian distribution, the detailed features around the vertex can be more accurately represented, thereby improving the accuracy of the model. In specific implementation, the Gaussian distribution radius can be proportionally reduced according to the difference between the vertex density and the threshold; when the vertex density is less than or equal to the preset density threshold, the Gaussian distribution radius is expanded. In areas with low vertex density, expanding the Gaussian distribution radius can smooth the transition between vertices and reduce the rendering load. Similarly, the Gaussian distribution radius can be proportionally expanded according to the difference between the vertex density and the threshold (or the absolute value of the vertex density). Finally, point cloud data is generated according to the adjusted Gaussian distribution parameters, and geometric bodies and materials are created based on the point cloud data. The created geometric bodies and materials are combined into a Mesh object and added to the Three.js scene. The present invention can dynamically adjust the Gaussian distribution radius according to the local complexity of the model, thereby reducing the rendering load while ensuring the model accuracy, and improving the overall rendering effect and performance.

[0092] In step 103, according to the current model data's real-world geographic location, the model's latitude, longitude, and altitude are set. Furthermore, the model's rotation angle and scaling parameters are set to adjust its orientation and size. The loaded model is mapped from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, including:

[0093] Calculate the rotation quaternion according to the latitude and longitude, altitude and rotation parameters of the loaded model;

[0094] The loaded model is synchronized from the Cesium coordinate system to the Three.js right-handed coordinate system using the rotation quaternion.

[0095] Optionally, perform matrix operations on the position information based on the model parameters to obtain the model's rotation quaternion, as shown in the following formula:

[0096]

[0097] Here, θ is half the actual rotation angle, and U is the rotation axis represented by a unit vector. The rotation quaternion accurately describes the model's rotation from Cesium's ENU coordinate system to the Three.js right-handed coordinate system, ensuring that the model is displayed at the correct angle and orientation in the Three.js scene, matching the perspective and layout of the Cesium Earth scene.

[0098] Optionally, use Cesium's matrix operation function to convert the camera's local coordinates into world coordinates to determine the camera's actual position and direction in the 3D scene, providing an accurate data basis for subsequent perspective adjustments, as shown in the following formula:

[0099]

[0100] Where M is the transformation matrix, r, u, and f are the direction vectors of the local coordinate axes in the world coordinate system, and o is the position of the local coordinate system origin in the world coordinate system. Use the perspective transformation method provided by Cesium to move the camera to the specified position and direction.

[0101] In step 104, the rendered model is processed by a preset frustum clipping method to obtain an optimized model, including:

[0102] Constructing a dynamic bounding box according to the rendered model, calculating the intersection of the dynamic bounding box and the viewing cone according to the camera viewing angle, determining the intersection portion, and rendering the intersection portion;

[0103] Establish a memory pool management model memory block and reclaim the memory block with a reference count of zero through the reference counting mechanism.

[0104] Optionally, when the Three.js camera's perspective changes, the near and far clipping plane parameters are dynamically modified based on the near and far clipping plane adjustment algorithm. The camera's perspective, aspect ratio, and near and far clipping planes influence the generation of the view frustum, which represents the range of space currently visible in the system. Each model has a bounding box, and the intersection of the view frustum and the bounding box is determined when the perspective moves. The portion of the model's bounding box that intersects the view frustum is rendered, while the non-intersecting portion is marked as pending clipping and not sent to the rendering pipeline. The view frustum changes dynamically as the camera moves and rotates. Therefore, view frustum clipping is performed in real time.

[0105] Optionally, during the frustum clipping process, the memory resources occupied by the parts marked as to be clipped need to be reclaimed in a timely manner to avoid memory leaks and performance degradation. Establish a memory pool to manage the memory allocation and recycling of model data. When models are loaded into memory, space is allocated from the memory pool; when they are clipped, the occupied space is released back to the memory pool. Maintain a reference count for each memory block. When models are loaded, the reference count is increased; when they are clipped, the reference count is decreased. When the reference count reaches zero, it means that the memory block is no longer in use and can be safely recycled.

[0106] This method can simplify the workflow. It does not require GISBox or other file format conversion software to convert to 3DTiles format. 3DGS models can be directly loaded into Cesium, reducing the tedious format conversion process and shortening the project processing flow.

[0107] It can leverage its technical advantages, combining Cesium's powerful geospatial data processing and visualization capabilities with Three.js's outstanding performance in 3D graphics rendering and interaction, to provide accurate geographic positioning, detailed rendering, and interactive control for 3DGS models, improving model visual effects and user experience.

[0108] It can ensure data integrity and accuracy, reduce data loss and precision loss caused by format conversion, and guarantee the quality of the final unit scene display effect and data accuracy;

[0109] It can achieve enhanced physically realistic rendering effects, integrate Cesium sun azimuth and Three.js parallel light direction mapping, make dynamic lighting color temperature deviation conform to CIEDE2000 standards, support 24-hour natural lighting transition, and achieve cross-engine shadow consistency;

[0110] A coordinated mechanism between frustum culling and dynamic memory reclamation is also provided. Frustum culling decisions must be reflected in real-time in the memory reclamation mechanism. Once a model is marked for pruning, the memory reclamation mechanism should immediately respond and prepare to reclaim the occupied memory, employing a garbage collection algorithm to optimize the memory reclamation process. Reclaimed memory blocks are reused to reduce the overhead of memory allocation and deallocation. Memory pool management ensures that reclaimed memory blocks can be quickly allocated to new models, improving rendering performance, reducing memory usage by 50%, enhancing system stability, and reducing crash rates by 80%.

[0111] Figure 2This is the second flow diagram of the Cesium-based 3DGS model loading method provided by the present invention. In an optional embodiment, the technical solution of the present invention is applied to a digital 3D city construction project, aiming to create a precise urban digitization platform and provide comprehensive services for urban planning. In this project, 3DGS models are loaded to construct realistic urban geographic scenes, such as models of city landmarks and large public facilities.

[0112] Specific implementation steps include:

[0113] 1. Initialize the environment and build the Cesium basic environment: During the project development process, first introduce the Cesium library and related dependencies into the project. After the Cesium initialization operation, create the Cesium 3D globe. Create a Three.js environment and add related components: After introducing the Three.js library, create a renderer and set the anti-aliasing effect and resolution according to project requirements. Create a scene and lens, set the viewing angle to 45 degrees, the aspect ratio to adapt to the window size, the near clipping plane to 0.1, and the far clipping plane to 1000 to ensure that the model within the field of view is clearly displayed while avoiding unnecessary rendering calculations. Associate the Cesium globe with the Three.js scene: Set the Three.js scene origin precisely at the center of the Cesium globe to establish a close connection between the two different coordinate systems. When the Three.js scene perspective moves, the Cesium globe perspective can move synchronously in real time and maintain lighting consistency.

[0114] 2. Load the model and read the data: Taking a 3DGS model of a large urban building complex as an example, request the model data based on the model's address. Convert to a Gaussian point cloud for display: For each vertex data parsed from the building complex model file, generate an appropriate Gaussian distribution for each fixed point. Create a Mesh object and add it to the scene: Based on the generated Gaussian point cloud data, create a geometry object that meets the requirements of Three.js and add a standard lighting material. Combine the created geometry and material into a Mesh object and add it to the Three.js scene. The building complex model will then be clearly displayed in the scene.

[0115] 3. Render the model and set model parameters: Set accurate latitude, longitude, altitude, and other location information for the building complex model to ensure that its position on the Cesium 3D globe accurately matches the actual geographic location. At the same time, set the rotation angle and scale ratio parameters to fine-tune the orientation and size of the model to make it consistent with the surrounding environment. Matrix operations: Based on the model parameters, perform matrix operations on the position information to obtain the model's rotation quaternion, and change the rotation of the building complex model from the Cesium coordinate system to the Three.js coordinate system. Camera adjustment: Use the perspective conversion method provided by Cesium to move the camera to the specified position and direction to provide users with the best viewing angle.

[0116] 4. Effect optimization: The model is clipped according to the view frustum. When part of the model is clipped, the memory is recycled. When the view frustum changes, clipping and memory recycling are performed in real time.

[0117] Figure 3 is Figure 2 Based on the illustrated embodiment, the present invention provides a Cesium loading 3DGS model rendering. Based on this, the present invention can implement a loading method without file type conversion: protected in the Cesium platform, the 3DGS model is not converted into 3DTiles in advance with the help of GISBox or other file format conversion software, but a method of directly loading the 3DGS model, avoiding the cumbersome format conversion process in the existing loading method; a loading solution that can be combined with Cesium and Three.js: covering a complete set of solutions for combining the Cesium library and Three.js to load 3DGS models, including a series of steps and specific implementation technologies such as initializing the environment, loading the model, and rendering the model; geospatial rendering collaborative technology: with a unified dynamic lighting method, achieved through a real-time synchronization algorithm of the Cesium sun azimuth and the Three.js parallel light parameters; a collaborative mechanism that can combine frustum clipping with dynamic memory recovery: based on the Three.js frustum construction and bounding box intersection monitoring, the model part outside the field of view is dynamically destroyed and the memory recovery mechanism is triggered to achieve synchronization between memory recovery and rendering frame cycle.

[0118] Figure 43DGS model loading device based on Cesium provided by the present invention is a structural schematic diagram. The Cesium-based 3DGS model loading device includes an initialization unit 1. The initialization unit 1 is used to introduce the Cesium library, create a Cesium three-dimensional globe and overlay a Tiantu map base map, introduce Three.js to create a renderer, a Three.js scene and a lens, and set the Three.js scene origin to the center point of the Cesium three-dimensional globe to achieve perspective synchronization when the scene moves. The working principle of the initialization unit 1 can refer to the aforementioned step 101 and will not be repeated here.

[0119] The Cesium-based 3DGS model loading device also includes a loading unit 2, which is used to obtain the 3DGS model data to be loaded from a preset server, parse the vertex data of the 3DGS model data to be loaded and generate point cloud data through a Gaussian distribution algorithm, create geometry and materials based on the point cloud data, and add them to the Three.js scene after forming a Mesh object to obtain a loaded model. The working principle of the loading unit 2 can refer to the aforementioned step 102 and will not be repeated here.

[0120] The Cesium-based 3DGS model loading device also includes a rendering unit 3, which is used to map the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjust the camera position and direction, and obtain the rendered model. The working principle of the rendering unit 3 can be referred to the aforementioned step 103 and will not be repeated here.

[0121] The Cesium-based 3DGS model loading device also includes an optimization unit 4, which is used to process the rendered model through a preset frustum clipping method to obtain an optimized model. The working principle of the optimization unit 4 can be referred to the aforementioned step 104 and will not be repeated here.

[0122] The loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted into 3DTiles format during the loading process.

[0123] The present invention proposes a loading method without file type conversion, which directly loads 3DGS models in the Cesium platform without the need to pre-convert the 3DGS model into the 3DTiles format with the help of GISBox or other file format conversion software. This method greatly simplifies the workflow, shortens project processing time, and improves work efficiency. By introducing the Cesium library and the Three.js library and cleverly combining the two, the rapid processing of geospatial data and the fine rendering of complex 3D models are achieved. Cesium is responsible for providing accurate geographic positioning and terrain matching, while Three.js focuses on the rendering and interaction of 3D graphics. The two work together to significantly improve data processing efficiency. Since the tedious format conversion process is avoided, the present invention effectively reduces problems such as data loss and precision loss caused by format conversion, which ensures the final three-dimensional scene display effect and data accuracy, and provides more reliable basic data support for urban planning, management and citizen services.

[0124] Figure 5 Schematic diagram of the structure of the electronic device provided by the present invention. Figure 5 As shown, the electronic device may include: a processor (processor) 110, a communication interface (Communications Interface) 120, a memory (memory) 130 and a communication bus 140, wherein the processor 110, the communication interface 120, and the memory 130 communicate with each other through the communication bus 140. The processor 110 can call the logic instructions in the memory 130 to execute the Cesium-based 3DGS model loading method, which includes: introducing the Cesium library, creating a Cesium three-dimensional globe and overlaying a Tiantu map base map, introducing Three.js to create a renderer, a Three.js scene, and a lens, setting the origin of the Three.js scene to the center point of the Cesium three-dimensional globe to achieve perspective synchronization when the scene moves; obtaining the 3DGS model data to be loaded from a preset server, parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data through a Gaussian distribution algorithm, creating geometry and materials based on the point cloud data, and adding them to the Three.js scene after forming a Mesh object to obtain a loaded model; mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjusting the camera position and direction to obtain a rendered model; processing the rendered model through a preset frustum clipping method to obtain an optimized model; the loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process.

[0125] In addition, the logic instructions in the above-mentioned memory 130 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a Cesium-based 3DGS model loading method provided by the above methods, the method comprising: introducing a Cesium library, creating a Cesium three-dimensional globe and overlaying a Tiantu map base map, introducing Three.js to create a renderer, a Three.js scene, and a lens, setting the Three.js scene origin to the center point of the Cesium three-dimensional globe to achieve perspective synchronization when the scene moves; obtaining the 3DGS to be loaded from a preset server Model data, parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data through a Gaussian distribution algorithm, creating geometric bodies and materials based on the point cloud data, and adding them to the Three.js scene after forming a Mesh object to obtain a loaded model; mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjusting the camera position and direction to obtain a rendered model; processing the rendered model through a preset frustum clipping method to obtain an optimized model; the loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process.

[0127] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the Cesium-based 3DGS model loading method provided by the above methods, the method comprising: introducing the Cesium library, creating a Cesium three-dimensional globe and overlaying a Tiandi Map base map, introducing Three.js to create a renderer, a Three.js scene, and a lens, setting the Three.js scene origin to the center point of the Cesium three-dimensional globe to achieve perspective synchronization when the scene moves; obtaining the 3DGS model data to be loaded from a preset server, parsing the 3DGS model data to be loaded, and The vertex data of the S model data is used to generate point cloud data through a Gaussian distribution algorithm, and geometric bodies and materials are created based on the point cloud data. After forming a Mesh object, the loaded model is added to the Three.js scene to obtain a loaded model; the loaded model is mapped from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, and the camera position and direction are dynamically adjusted to obtain a rendered model; the rendered model is processed through a preset view frustum clipping method to obtain an optimized model; the loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process.

[0128] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0129] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A 3DGS model loading method based on Cesium, characterized in that: include: Import the Cesium library, create a Cesium 3D globe and overlay the Tiantu map basemap, import Three.js to create a renderer, Three.js scene, and camera, and set the Three.js scene origin to the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves; Obtaining the 3DGS model data to be loaded from a preset server, parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data using a Gaussian distribution algorithm, creating geometric bodies and materials based on the point cloud data, and adding them to the Three.js scene after forming a Mesh object to obtain the loaded model; Mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjusting the camera position and direction to obtain a rendered model; Processing the rendered model by a preset frustum clipping method to obtain an optimized model; The loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted into 3DTiles format during the loading process.

2. The Cesium-based 3DGS model loading method according to claim 1, characterized in that: The introduction of Three.js to create a renderer, Three.js scene, and lens includes: Import Three.js, create a renderer, set anti-aliasing parameters and resolution parameters, and create a Three.js scene to accommodate three-dimensional objects; Create a lens, set the initial far clipping plane value to 1000, and set the initial near clipping plane value to 1; When the camera perspective or scene content changes, the far clipping plane value and the near clipping plane value are dynamically adjusted according to the preset formula.

3. The Cesium-based 3DGS model loading method according to claim 2, characterized in that: The dynamically adjusting the far clipping plane value and the near clipping plane value according to the preset formula includes: Determining a first weighted value according to a product of a precision coefficient and a camera height; Determining a second weighted value according to the product of the model complexity coefficient and the model complexity; Determine a first weight value according to the product of the first weight value and a first weight coefficient, determine a second weight value according to the product of the second weight value and a second weight coefficient, and determine a clipping surface value according to the sum of the first weight value and the second weight value; The clipping plane value includes a far clipping plane value and a near clipping plane value.

4. The Cesium-based 3DGS model loading method according to claim 2, characterized in that: Before or after dynamically adjusting the far and near clipping plane values ​​according to the preset formula, the preset geographic lighting unified algorithm is used to synchronize the Cesium sun azimuth and the Three.js parallel light direction, specifically including: Calculate the sun azimuth angle based on the Cesium sun azimuth angle parameter, and map the sun azimuth angle to the Three.js parallel light parameter to synchronize the Cesium sun azimuth angle with the Three.js parallel light direction.

5. The Cesium-based 3DGS model loading method according to claim 1, characterized in that: The step of parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data by using a Gaussian distribution algorithm includes: Parsing vertex data of the 3DGS model data to be loaded, wherein the vertex data includes vertex coordinates, vertex colors, and normal attributes; For each vertex, a Gaussian distribution parameter is generated by a Gaussian distribution algorithm, and the point cloud data is created according to the Gaussian distribution parameter.

6. The Cesium-based 3DGS model loading method according to claim 5, characterized in that: After parsing the vertex data of the 3DGS model data to be loaded, dynamically adjusting the Gaussian distribution radius according to the vertex density; The dynamic adjustment of the vertex density of the Gaussian distribution radius includes: When the vertex density is greater than a preset density threshold, reducing the Gaussian distribution radius to improve model accuracy; When the vertex density is less than or equal to the preset density threshold, the Gaussian distribution radius is enlarged to reduce rendering load.

7. The Cesium-based 3DGS model loading method according to claim 1, characterized in that: Mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation includes: Calculate the rotation quaternion according to the latitude and longitude, altitude and rotation parameters of the loaded model; The loaded model is synchronized from the Cesium coordinate system to the Three.js right-handed coordinate system using the rotation quaternion.

8. The Cesium-based 3DGS model loading method according to claim 1, characterized in that: The step of processing the rendered model by using a preset frustum clipping method to obtain an optimized model includes: Constructing a dynamic bounding box according to the rendered model, calculating the intersection of the dynamic bounding box and the viewing cone according to the camera viewing angle, determining the intersection portion, and rendering the intersection portion; Establish a memory pool management model memory block and reclaim the memory block with a reference count of zero through the reference counting mechanism.

9. A 3DGS model loading device based on Cesium, characterized in that: include: An initialization unit, which is used to import the Cesium library, create a Cesium 3D globe and overlay a Tiantu map basemap, import Three.js to create a renderer, a Three.js scene, and a camera, and set the Three.js scene origin to the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves; A loading unit, configured to obtain 3DGS model data to be loaded from a preset server, parse vertex data of the 3DGS model data to be loaded, generate point cloud data using a Gaussian distribution algorithm, create geometric bodies and materials based on the point cloud data, and add the resulting mesh objects to the Three.js scene to obtain a loaded model; A rendering unit, configured to map the loaded model from the Cesium coordinate system to the Three.js coordinate system through a preset matrix operation, dynamically adjust the camera position and direction, and obtain a rendered model; an optimization unit, configured to process the rendered model using a preset frustum clipping method to obtain an optimized model; The loaded 3DGS model data is in Ply format or Splat format, and the loaded 3DGS model data is not converted into 3DTiles format during the loading process.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the Cesium-based 3DGS model loading method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Mass oblique photography model loading optimization method based on Cesium

    CN114943637A

  • Massive true three-dimensional model loading optimization method

    CN117372599A

  • Universal generation method and system for CesiumJS complex dynamic texture

    CN117573250A

  • Turnout three-dimensional visualization method, device, equipment and medium

    CN119152134A

  • Close-shot three-dimensional reconstruction method, device and equipment based on 3DGS

    CN119445003A

Cited By

  • Burr-free cutting method, device and equipment for 3D GS scene editing and medium

    CN121639999A

  • Bumpless cropping method, device and equipment for 3D GS scene editing and medium

    CN121639999B