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

By combining Cesium and the Three.js library on the Cesium platform, 3DGS models in Ply or Splat format can be directly loaded. By using Gaussian distribution and view frustum clipping, the problems of cumbersome format conversion and low rendering performance during the loading process are solved, achieving efficient and accurate 3D model loading and rendering, and improving system stability and data integrity.

CN120655874BActive Publication Date: 2026-03-03MOBILE BROADCASTING & INFORMATION SERVICE IND INNOVATION RES INST (WUHAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

When loading 3DGS models directly on the Cesium platform, there are problems such as cumbersome format conversion, data loss, loss of precision and low rendering performance. In particular, when combined with Three.js, there is a lack of geospatial data processing capabilities and rendering coordination of complex 3D models.

Method used

By introducing the Cesium and Three.js libraries, 3DGS models in Ply or Splat format are directly loaded. Point cloud data is generated using the Gaussian distribution algorithm. Combined with matrix operations and view frustum clipping, accurate geolocation and detailed rendering of the model are achieved. Clipping polygons and camera positions are dynamically adjusted. A unified geolighting algorithm is integrated, and memory management is optimized.

Benefits of technology

The loading process has been simplified, data processing efficiency and accuracy have been improved, memory usage has been reduced, rendering performance and system stability have been enhanced, and the display effect and data integrity of the 3D scene have been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655874B_ABST
    Figure CN120655874B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, and device for loading 3DGS models based on Cesium, relating to the field of 3D model processing. The method includes: importing the Cesium library, creating a Cesium 3D globe and overlaying a Tianditu base map; importing Three.js to create a renderer, a Three.js scene, and a camera, setting the origin of the Three.js scene as the center point of the Cesium 3D globe; acquiring the 3DGS model data to be loaded, parsing the vertex data of the 3DGS model data to be loaded, generating point cloud data using 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 the loaded model; mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system, dynamically adjusting the camera position and orientation to obtain the rendered model; and processing the rendered model to obtain an optimized model. This invention eliminates the need to pre-convert the 3DGS model to 3DTiles format, simplifying the workflow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of 3D model processing, and in particular to a 3DGS model loading method, apparatus and device based on Cesium. Background Technology

[0002] With the acceleration of urbanization, modern cities are rapidly moving towards digitalization and informatization. Digital 3D cities, as a significant achievement in urban informatization, use digital methods to accurately model and present the city's geographic information and architectural facilities in 3D. This provides urban planners with intuitive and accurate decision-making support, offers city managers real-time and dynamic urban operation monitoring data, and provides citizens with rich and convenient urban information services. The construction of digital 3D cities requires processing and displaying a large amount of complex 3D model data. Among these, 3DGS models, due to their ability to highly reproduce urban geographic scenes, have become one of the important data sources for digital 3D city construction. However, directly loading 3DGS models onto the Cesium platform faces certain technical challenges.

[0003] Cesium, a powerful geospatial data processing and visualization tool, boasts excellent geographic data compatibility and terrain rendering capabilities. Its built-in terrain rendering engine efficiently handles large-scale terrain data and dynamically adjusts terrain precision based on the user's viewpoint and distance from the terrain using Level of Detail (LOD) technology, significantly improving rendering efficiency while maintaining visual quality. However, Cesium has limitations when handling complex 3D model files, especially those in formats not natively supported (such as Ply or Splat formats for 3DGS models). On the other hand, Three.js, a library focused on 3D graphics rendering and interaction, excels in rendering complex 3D models. However, Three.js lacks the geospatial data processing capabilities of Cesium, making it difficult to directly provide accurate geolocation and terrain matching for 3D models.

[0004] Currently, loading 3DGS models in Cesium typically requires using GISBox or other file format conversion software to pre-convert the 3DDTiles format, which is supported by Cesium, before loading. This process is not only cumbersome, increasing project workflow and time costs, but it can also lead to data loss and accuracy degradation during conversion, affecting the final 3D scene display and data accuracy. Frequent format conversions also reduce project maintainability and scalability. Different conversion software may have compatibility issues, and the conversion process may become unstable or even fail when dealing with large-scale data or complex model structures. Furthermore, existing technologies often lack effective memory management and rendering optimization methods when loading and rendering large-scale 3D models. As model complexity increases and perspectives change, rendering performance and memory usage become key factors limiting system performance. Especially in scenarios where Cesium is used in conjunction with Three.js, effectively leveraging the advantages of both to achieve accurate processing of geospatial data and detailed rendering of complex 3D models, while ensuring system stability and performance, has become a pressing technical problem to be solved. Currently, there is no technical solution that can solve the above-mentioned technical problems, and there is no 3DGS model loading method, device, or equipment based on Cesium. Summary of the Invention

[0005] This invention provides a method, apparatus, and device for loading 3DGS models based on Cesium, proposing a novel 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] The Cesium library is introduced to create a Cesium 3D globe and overlay a Tianditu base map. Three.js is introduced to create a renderer, a Three.js scene, and a camera. The origin of the Three.js scene is set as the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves.

[0008] The system retrieves 3DGS model data to be loaded from a preset server, parses the vertex data of the 3DGS model data to be loaded and generates point cloud data through a Gaussian distribution algorithm, creates geometry and materials based on the point cloud data, and adds them to the Three.js scene after forming a Mesh object to obtain the loaded model.

[0009] The loaded model is mapped from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations, and the camera position and orientation are dynamically adjusted to obtain the rendered model.

[0010] The rendered model is processed by a preset view frustum clipping method to obtain an optimized model;

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

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

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

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

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

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

[0017] The first weighting value is determined by the product of the accuracy coefficient and the camera height;

[0018] The second weighting value is determined based on the product of the model complexity coefficient and the model complexity.

[0019] The first weight value is determined by the product of the first weight value and the first weight coefficient; the second weight value is determined by the product of the second weight value and the second weight coefficient; and the cutting face value is determined by the sum of the first weight value and the second weight value.

[0020] The cutting face value includes the far cutting face value and the near cutting face value.

[0021] According to the Cesium-based 3DGS model loading method provided by this invention, before or after dynamically adjusting the far clipping polygon and near clipping polygon according to a preset formula, the Cesium solar azimuth angle and the Three.js parallel light direction are synchronized using a preset geo-illumination unification algorithm. Specifically, this includes:

[0022] The solar azimuth angle is calculated based on the Cesium solar azimuth angle parameters, and the solar azimuth angle is mapped to the Three.js parallel light parameters to achieve synchronization between the Cesium solar azimuth angle and the Three.js parallel light direction.

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

[0024] The vertex data of the 3DGS model data to be loaded is parsed, and the vertex data includes vertex coordinates, vertex color, and normal properties.

[0025] For each vertex, Gaussian distribution parameters are generated using a Gaussian distribution algorithm, and the point cloud data is created based on the Gaussian distribution parameters.

[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] If the vertex density is greater than a preset density threshold, the radius of the Gaussian distribution is reduced to improve model accuracy.

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

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

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

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

[0033] According to the Cesium-based 3DGS model loading method provided by the present invention, the step of processing the rendered model through a preset view frustum clipping method to obtain an optimized model includes:

[0034] A dynamic bounding box is constructed based on the rendered model, and the intersection of the dynamic bounding box and the view frustum is calculated based on the camera viewpoint. The intersection part is determined and the intersection part is rendered.

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

[0036] Secondly, a Cesium-based 3DGS model loading device is provided, including:

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

[0038] The loading unit is used to obtain 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 the loaded model.

[0039] A rendering unit is used to map the loaded model from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations, dynamically adjust the camera position and orientation, and obtain the rendered model.

[0040] An optimization unit is used to process the rendered model using a preset view frustum clipping method to obtain an optimized model.

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

[0042] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the Cesium-based 3DGS model loading method.

[0043] This invention proposes a loading method that bypasses file type conversion, directly loading 3DGS models into the Cesium platform. This eliminates the need for GISBox or other file format conversion software to pre-convert 3DGS models to 3DTiles format, significantly simplifying the workflow, shortening project processing time, and improving efficiency. By introducing and cleverly combining the Cesium and Three.js libraries, it achieves rapid processing of geospatial data and detailed rendering of complex 3D models. Cesium provides accurate geolocation and terrain matching, while Three.js focuses on 3D graphics rendering and interaction. Their collaborative work significantly improves data processing efficiency. By avoiding cumbersome format conversion processes, this invention effectively reduces potential data loss and accuracy degradation caused by format conversion, ensuring the final 3D scene display effect and data accuracy. This provides more reliable basic data support for urban planning, management, and citizen services. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0045] Figure 1 This is one of the flowcharts illustrating the Cesium-based 3DGS model loading method provided by this invention;

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

[0047] Figure 3 This is a screenshot of the effect of loading a 3DGS model using Cesium, provided by this invention.

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

[0049] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0051] Combining Cesium with Three.js for loading 3DGS models fully leverages the strengths of both. Cesium's geospatial processing capabilities provide accurate geolocation and terrain matching for 3DGS models, while Three.js enables fine-grained rendering and interactive control of 3DGS models, enhancing the model's visual appeal and user experience. Figure 1 This is one of the flowcharts illustrating the Cesium-based 3DGS model loading method provided by the present invention. The Cesium-based 3DGS model loading method includes:

[0052] Step 101: Import the Cesium library, create a Cesium 3D globe and overlay a Tianditu base map, import Three.js to create a renderer, a Three.js scene and a camera, and set the origin of the Three.js scene 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 and generate point cloud data through the 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 the loaded model.

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

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

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

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

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

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

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

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

[0062] Optionally, import the Three.js library into your project, create a renderer object, which handles lighting, materials, textures, and other information in the scene and outputs it to the screen. Set renderer parameters, such as anti-aliasing and resolution, to improve rendering quality. Create a Three.js scene to house the 3D objects, and create a camera object to determine the camera's viewpoint and field of view. Set the initial far clipping plane value of the camera to 1000 and the near clipping plane value to 1; these values ​​will be dynamically adjusted later based on the scene content.

[0063] When the camera viewpoint or scene content changes subsequently, the far and near clipping plane parameters are dynamically modified to maintain normal model rendering. Properly setting 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 a preset formula includes:

[0064] The first weighting value is determined by the product of the accuracy coefficient and the camera height;

[0065] The second weighting value is determined based on the product of the model complexity coefficient and the model complexity.

[0066] The first weight value is determined by the product of the first weight value and the first weight coefficient; the second weight value is determined by the product of the second weight value and the second weight coefficient; and the cutting face value is determined by the sum of the first weight value and the second weight value.

[0067] The cutting face value includes the far cutting face value and the near cutting face value.

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

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

[0070] Where k is the accuracy coefficient, which varies with camera height; d is the camera height; c is the model complexity coefficient, which varies with model complexity; and t is the model complexity.

[0071] Optionally, the origin of the Three.js scene can be set to the center point of the Cesium 3D globe, linking the Cesium globe with the Three.js scene. This ensures that when the Three.js scene moves, the Cesium 3D globe's viewpoint moves synchronously, achieving viewpoint synchronization during scene movement. In linking the Cesium globe and the Three.js scene, the origin of the Three.js scene is set to the center point of the Cesium globe, establishing a connection between the two different coordinate systems. When the Three.js scene moves, the Cesium globe's viewpoint also moves synchronously. Simultaneously, an integrated geolighting algorithm enhances the realism of the 3D model and the physical consistency of the scene while maintaining geographic accuracy. Both Cesium and Three.js undergo geolighting processing, avoiding shadow distortion and anti-aliasing issues.

[0072] Optionally, before or after dynamically adjusting the far and near clipping faces according to a preset formula, the Cesium solar azimuth angle and the Three.js parallel light direction are synchronized using a preset geo-illumination unification algorithm. Specifically, this includes:

[0073] The solar azimuth angle is calculated based on the Cesium solar azimuth angle parameters, and the solar azimuth angle is mapped to the Three.js parallel light parameters to achieve synchronization between the Cesium solar azimuth angle and the Three.js parallel light direction.

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

[0075]

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

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

[0078]

[0079] Where θ is the solar azimuth angle and R is the coordinate axis alignment matrix.

[0080] In step 102, based on the given model address, model data is obtained from the server via a network request. The step of parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data using a Gaussian distribution algorithm includes:

[0081] The vertex data of the 3DGS model data to be loaded is parsed, and the vertex data includes vertex coordinates, vertex color, and normal properties.

[0082] For each vertex, Gaussian distribution parameters are generated using a Gaussian distribution algorithm, and the point cloud data is created based on the Gaussian distribution parameters.

[0083] Optionally, the converted model file contains attribute information such as vertex coordinates, color, and normals. Each vertex data parsed from the file is processed using Gaussian Splatting technology to generate a suitable Gaussian distribution for each vertex. This process accurately represents the point's position and appearance in 3D space using a Gaussian distribution. The probability density function of the Gaussian distribution is:

[0084]

[0085] Where μ is the mean vector representing the center of the Gaussian distribution, ∑ is the covariance matrix, and x-μ represents centering the data distribution.

[0086] Next, a Mesh object is created and added to the scene. Based on Gaussian point cloud data, a geometry object conforming to Three.js requirements is created. To more closely resemble a realistic effect, standard lighting materials are created for the geometry. The created geometry and materials are combined into a Mesh object, which is then added to the Three.js scene, allowing the model to be displayed in the scene.

[0087] Optionally, 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;

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

[0089] If the vertex density is greater than a preset density threshold, the radius of the Gaussian distribution is reduced to improve model accuracy.

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

[0091] First, following the standard procedure, the vertex data of the 3DGS model to be loaded is parsed, including vertex coordinates, vertex colors, and normal attributes. A reasonable spatial range is determined, and the number of vertices within this range is counted. Based on the size of the spatial range and the number of vertices, the vertex density is calculated. Based on experience or experimental data, a reasonable preset density threshold is set. This threshold is used to distinguish different complexity regions of the model, thus determining the direction of adjustment for 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 vertices can be represented more accurately, thereby improving the model's accuracy. In practice, the Gaussian distribution radius can be reduced proportionally based on 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 smoothly transition between vertices, reducing the rendering load. Similarly, the Gaussian distribution radius can be expanded proportionally based on the difference between the vertex density and the threshold (or the absolute value of the vertex density). Finally, point cloud data is generated based on the adjusted Gaussian distribution parameters. Geometry and materials are created based on the point cloud data, and the created geometry and materials are combined into a Mesh object and added to the Three.js scene. This invention can dynamically adjust the Gaussian distribution radius according to the local complexity of the model, thereby reducing the rendering load and improving the overall rendering effect and performance while ensuring the accuracy of the model.

[0092] In step 103, based on the real-world geographical location of the current model data, latitude, longitude, and altitude are set for the model. Rotation angle and scaling parameters are also set to adjust the model's orientation and size. The process of mapping the loaded model from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations includes:

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

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

[0095] Optionally, matrix operations can be performed on the position information based on the model parameters to obtain the rotation quaternion of the model, as shown in the following formula:

[0096]

[0097] Where θ is half of the actual rotation angle, and U is the rotation axis represented by a unit vector. Rotation quaternions can accurately describe the rotational changes of the model from Cesium's ENU coordinate system to the Three.js right-handed coordinate system, ensuring that the model can be displayed at the correct angle and orientation in the Three.js scene, matching the viewpoint and layout of the Cesium Earth scene.

[0098] Optionally, Cesium's matrix operation capabilities can be used to convert the camera's local coordinates to world coordinates, determining the camera's actual position and orientation in the 3D scene. This provides an accurate data foundation for subsequent viewpoint 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 origin of the local coordinate system in the world coordinate system. The camera is moved to the specified position and direction using the view transformation method provided by Cesium.

[0101] In step 104, the process of processing the rendered model using a preset view frustum clipping method to obtain an optimized model includes:

[0102] A dynamic bounding box is constructed based on the rendered model, and the intersection of the dynamic bounding box and the view frustum is calculated based on the camera viewpoint. The intersection part is determined and the intersection part is rendered.

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

[0104] Optionally, when the camera viewpoint changes in Three.js, the near and far clipping plane parameters are dynamically adjusted based on the near and far clipping plane adjustment algorithm. The camera viewpoint, aspect ratio, and near and far clipping planes affect the generation of the view frustum, whose extent is the currently visible spatial range within the system. Each model has a bounding box, and the intersection of the view frustum and the bounding box is determined when the viewpoint moves. The portion where the model's bounding box intersects with the view frustum is rendered; the non-intersecting portion is marked as awaiting clipping and is not sent to the rendering pipeline. As the camera moves and rotates, the view frustum changes dynamically. Therefore, view frustum clipping is performed in real time.

[0105] Optionally, during view frustum pruning, the memory resources occupied by the portions marked as awaiting pruning need to be reclaimed promptly to avoid memory leaks and performance degradation. A memory pool is established to manage the memory allocation and reclamation of model data. When models are loaded into memory, space is allocated from the memory pool; when they are pruned, the occupied space is released back to the memory pool. A reference count is maintained for each memory block. When models are loaded, the reference count is incremented; when they are pruned, the reference count is decremented. When the reference count is zero, it indicates that the memory block is no longer in use and can be safely reclaimed.

[0106] This invention simplifies the workflow, eliminating the need to use GISBox or other file format conversion software to convert to 3D GS format. It allows 3DGS models to be loaded directly into Cesium, reducing tedious format conversion steps and shortening project processing time.

[0107] It can leverage its technological advantages, combining Cesium's powerful geospatial data processing and visualization capabilities with Three.js's excellent performance in 3D graphics rendering and interaction, to provide accurate geolocation, fine rendering and interactive control for 3DGS models, thereby improving the model's visual effects and user experience;

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

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

[0110] It also provides a collaborative mechanism for view frustum pruning and dynamic memory reclamation. View frustum pruning decisions need to be reflected in the memory reclamation mechanism in real time. Once a model is marked as awaiting pruning, the memory reclamation mechanism should respond immediately, preparing to reclaim the memory it occupies, and 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 up to 50%, enhancing system stability, and reducing the crash rate by 80%.

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

[0112] The specific implementation steps include:

[0113] 1. Initialize the environment and set up the basic Cesium environment: During project development, first, import the Cesium library and related dependencies into the project. After Cesium initialization, create the Cesium 3D globe. Create the Three.js environment and add relevant components: After importing the Three.js library, create a renderer and set anti-aliasing and resolution according to project requirements. Create the scene and camera, setting the view 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, ensuring clear display of the model within the field of view while avoiding unnecessary rendering calculations. Link the Cesium globe with the Three.js scene: Precisely set the origin of the Three.js scene to the center point of the Cesium globe, establishing a close connection between the two different coordinate systems. When the Three.js scene view moves, the Cesium globe view moves synchronously in real time, maintaining consistent lighting.

[0114] 2. Loading the Model and Reading Data: Taking a large 3DGS model of a city's architectural complex as an example, the model data is requested based on its address. Converting to Gaussian Point Cloud for Display: For each vertex data parsed from the architectural complex model file, a suitable Gaussian distribution is generated for each vertex. Creating a Mesh Object and Adding it to the Scene: Based on the generated Gaussian point cloud data, a geometry object conforming to Three.js requirements is created, and standard lighting materials are added. The created geometry and materials are combined into a Mesh object and added to the Three.js scene, where the architectural complex model is clearly displayed.

[0115] 3. Model Rendering and Parameter Settings: Accurately set the latitude, longitude, and altitude of the building complex model to ensure its position on the Cesium 3D globe precisely matches its actual geographical location. Simultaneously, set rotation angle and scaling parameters to fine-tune the model's orientation and size, ensuring it harmonizes with its surroundings. Matrix Operations: Based on the model parameters, perform matrix operations on the position information to obtain the model's rotation quaternions, transforming the building complex model from the Cesium coordinate system to the Three.js coordinate system. Camera Adjustment: Utilize Cesium's viewpoint transformation methods to move the camera to a specified position and direction, providing the user with the optimal viewing angle.

[0116] 4. Effect optimization: The model is pruned using a view frustum based on the view domain. When a part of the model is pruned, memory is reclaimed. When the view domain changes, pruning and memory reclamation are performed in real time.

[0117] Figure 3 Is Figure 2 Based on the illustrated embodiments, the present invention provides a Cesium-loaded 3DGS model effect diagram. Based on this, the present invention can achieve a loading method without file type conversion: It protects the Cesium platform by directly loading 3DGS models without pre-converting them to 3DTiles using GISBox or other file format conversion software, avoiding the cumbersome format conversion process in existing loading methods; it can combine Cesium and Three.js loading schemes: covering a complete scheme for combining the Cesium library and Three.js for loading 3DGS models, including a series of steps and specific implementation technologies such as environment initialization, model loading, and model rendering; it can achieve geospatial rendering collaborative technology: possessing a dynamic lighting unification method, achieved through a real-time synchronization algorithm between Cesium solar azimuth angle and Three.js parallel light parameters; it can combine a view frustum clipping and dynamic memory reclamation collaborative mechanism: based on Three.js view frustum construction and bounding box intersection monitoring, it dynamically destroys the model parts outside the viewport and triggers the memory reclamation mechanism, achieving synchronization between memory reclamation and the rendering frame cycle.

[0118] Figure 4This is a schematic diagram of the structure of the Cesium-based 3DGS model loading device provided by the present invention. The Cesium-based 3DGS model loading device includes an initialization unit 1. The initialization unit 1 is used to import the Cesium library, create a Cesium 3D globe and overlay a Tianditu base map, import Three.js to create a renderer, a Three.js scene and a camera, and set the origin of the Three.js scene as the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves. The working principle of the initialization unit 1 can be referred to the aforementioned step 101, and will not be repeated here.

[0119] The Cesium-based 3DGS model loading device further includes a loading unit 2. The loading unit 2 is used to obtain 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 the loaded model. The working principle of the loading unit 2 can be referred 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. The rendering unit 3 is used to map the loaded model from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations, dynamically adjust the camera position and orientation, 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. The optimization unit 4 is used to process the rendered model using a preset view 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 or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process.

[0123] This invention proposes a loading method that bypasses file type conversion, directly loading 3DGS models into the Cesium platform. This eliminates the need for GISBox or other file format conversion software to pre-convert 3DGS models to 3DTiles format, significantly simplifying the workflow, shortening project processing time, and improving efficiency. By introducing and cleverly combining the Cesium and Three.js libraries, it achieves rapid processing of geospatial data and detailed rendering of complex 3D models. Cesium provides accurate geolocation and terrain matching, while Three.js focuses on 3D graphics rendering and interaction. Their collaborative work significantly improves data processing efficiency. By avoiding cumbersome format conversion processes, this invention effectively reduces potential data loss and accuracy degradation caused by format conversion, ensuring the final 3D scene display effect and data accuracy. This provides more reliable basic data support for urban planning, management, and citizen services.

[0124] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. For example... Figure 5 As shown, the electronic device may include: a processor 110, a communication interface 120, a 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 logical instructions in the memory 130 to execute a Cesium-based 3DGS model loading method. This method includes: importing the Cesium library, creating a Cesium 3D globe and overlaying a Tianditu base map, importing Three.js to create a renderer, a Three.js scene, and a camera, setting the origin of the Three.js scene as the center point of the Cesium 3D globe to achieve viewpoint synchronization during scene movement; obtaining 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 geometry 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 preset matrix operations, dynamically adjusting the camera position and orientation to obtain the rendered model; processing the rendered model using a preset view frustum clipping method to obtain an optimized model; the loaded 3DGS model data is in Ply or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process.

[0125] Furthermore, the logical instructions in the aforementioned memory 130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program that 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. This method includes: importing the Cesium library, creating a Cesium 3D globe and overlaying a Tianditu base map, importing Three.js to create a renderer, a Three.js scene, and a camera, setting the origin of the Three.js scene as the center point of the Cesium 3D globe to achieve perspective synchronization during scene movement; and obtaining the 3DGS model to be loaded from a preset server. The model data is processed by parsing the vertex data of the 3DGS model to be loaded and generating point cloud data using a Gaussian distribution algorithm. Geometry and materials are created based on the point cloud data, and after forming a Mesh object, it is added to the Three.js scene to obtain the loaded model. The loaded model is mapped from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations, and the camera position and orientation are dynamically adjusted to obtain the rendered model. The rendered model is then processed by a preset view frustum clipping method to obtain the optimized model. The loaded 3DGS model data is in Ply or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process.

[0127] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the Cesium-based 3DGS model loading method provided by the above methods. This method includes: importing the Cesium library; creating a Cesium 3D globe and overlaying a Tianditu base map; importing Three.js to create a renderer, a Three.js scene, and a camera; setting the origin of the Three.js scene as the center point of the Cesium 3D globe to achieve perspective synchronization during scene movement; obtaining the 3DGS model data to be loaded from a preset server; and parsing the 3DGS model data to be loaded. Vertex data from the S-model is used to generate point cloud data using a Gaussian distribution algorithm. Geometry and materials are created based on the point cloud data, and these are added to the Three.js scene after forming a Mesh object, resulting in a loaded model. The loaded model is then mapped from the Cesium coordinate system to the Three.js coordinate system using a preset matrix operation, and the camera position and orientation are dynamically adjusted to obtain a rendered model. The rendered model is then processed using a preset view frustum clipping method to obtain an optimized model. The loaded 3DGS model data is in Ply or Splat format, and 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. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0129] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some 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, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A 3DGS model loading method based on Cesium, characterized in that, include: The Cesium library is introduced to create a Cesium 3D globe and overlay a Tianditu base map. Three.js is introduced to create a renderer, a Three.js scene, and a camera. The origin of the Three.js scene is set as the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves. The system retrieves 3DGS model data to be loaded from a preset server, parses the vertex data of the 3DGS model data to be loaded and generates point cloud data through a Gaussian distribution algorithm, creates geometry and materials based on the point cloud data, and adds them to the Three.js scene after forming a Mesh object to obtain the loaded model. The loaded model is mapped from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations, and the camera position and orientation are dynamically adjusted to obtain the rendered model. The rendered model is processed by a preset view frustum clipping method to obtain an optimized model; The loaded 3DGS model data is in Ply or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process; The introduction of Three.js to create renderers, Three.js scenes, and cameras includes: Import Three.js, create a renderer, set anti-aliasing and resolution parameters, and create a Three.js scene to accommodate 3D objects; Create a shot, set the initial far clipping plane value to 1000, and set the initial near clipping plane value to 1; When the camera view or scene content changes, the far clipping plane value and the near clipping plane value are dynamically adjusted according to a preset formula. The step of dynamically adjusting the far cutting face value and the near cutting face value according to a preset formula includes: The first weighting value is determined by the product of the accuracy coefficient and the camera height; The second weighting value is determined based on the product of the model complexity coefficient and the model complexity. The first weight value is determined by the product of the first weight value and the first weight coefficient; the second weight value is determined by the product of the second weight value and the second weight coefficient; and the cutting face value is determined by the sum of the first weight value and the second weight value. The cutting face value includes the far cutting face value and the near cutting face value.

2. The 3DGS model loading method based on Cesium according to claim 1, characterized in that, Before or after dynamically adjusting the far and near clipping faces according to a preset formula, the Cesium solar azimuth angle and the Three.js parallel light direction are synchronized using a preset geographic illumination unification algorithm. Specifically, this includes: The solar azimuth angle is calculated based on the Cesium solar azimuth angle parameters, and the solar azimuth angle is mapped to the Three.js parallel light parameters to achieve synchronization between the Cesium solar azimuth angle and the Three.js parallel light direction.

3. The Cesium-based 3DGS model loading method according to claim 1, characterized in that, The process of parsing the vertex data of the 3DGS model data to be loaded and generating point cloud data using a Gaussian distribution algorithm includes: The vertex data of the 3DGS model data to be loaded is parsed, and the vertex data includes vertex coordinates, vertex color, and normal properties. For each vertex, Gaussian distribution parameters are generated using a Gaussian distribution algorithm, and the point cloud data is created based on the Gaussian distribution parameters.

4. The Cesium-based 3DGS model loading method according to claim 3, characterized in that, 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; The dynamic adjustment of the vertex density of the Gaussian distribution radius includes: If the vertex density is greater than a preset density threshold, the radius of the Gaussian distribution is reduced to improve model accuracy. If the vertex density is less than or equal to the preset density threshold, the radius of the Gaussian distribution is increased to reduce the rendering load.

5. The 3DGS model loading method based on Cesium according to claim 1, characterized in that, The step of 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 based on the latitude, longitude, altitude, and rotation parameters of the loaded model; Using the rotation quaternion, the loaded model is synchronized from the Cesium coordinate system to the right-handed coordinate system of Three.js.

6. The 3DGS model loading method based on Cesium according to claim 1, characterized in that, The process of processing the rendered model using a preset view frustum clipping method to obtain an optimized model includes: A dynamic bounding box is constructed based on the rendered model, and the intersection of the dynamic bounding box and the view frustum is calculated based on the camera viewpoint. The intersection part is determined and the intersection part is rendered. Establish a memory pool management model for memory blocks, and reclaim memory blocks with a reference count of zero through a reference counting mechanism.

7. A 3DGS model loading device based on Cesium, characterized in that, include: An initialization unit is used to import the Cesium library, create a Cesium 3D globe and overlay a Tianditu base map, import Three.js to create a renderer, a Three.js scene and a camera, and set the origin of the Three.js scene to the center point of the Cesium 3D globe to achieve perspective synchronization when the scene moves. The loading unit is used to obtain 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 the loaded model. A rendering unit is used to map the loaded model from the Cesium coordinate system to the Three.js coordinate system through preset matrix operations, dynamically adjust the camera position and orientation, and obtain the rendered model. An optimization unit is used to process the rendered model using a preset view frustum clipping method to obtain an optimized model. The loaded 3DGS model data is in Ply or Splat format, and the loaded 3DGS model data is not converted to 3DTiles format during the loading process; The introduction of Three.js to create renderers, Three.js scenes, and cameras includes: Import Three.js, create a renderer, set anti-aliasing and resolution parameters, and create a Three.js scene to accommodate 3D objects; Create a shot, set the initial far clipping plane value to 1000, and set the initial near clipping plane value to 1; When the camera view or scene content changes, the far clipping plane value and the near clipping plane value are dynamically adjusted according to a preset formula. The step of dynamically adjusting the far cutting face value and the near cutting face value according to a preset formula includes: The first weighting value is determined by the product of the accuracy coefficient and the camera height; The second weighting value is determined based on the product of the model complexity coefficient and the model complexity. The first weight value is determined by the product of the first weight value and the first weight coefficient; the second weight value is determined by the product of the second weight value and the second weight coefficient; and the cutting face value is determined by the sum of the first weight value and the second weight value. The cutting face value includes the far cutting face value and the near cutting face value.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the Cesium-based 3DGS model loading method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

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

    CN119445003A

  • System and method for fast rendering and editing 3D images in web browser

    KR102176837B1