Three-dimensional visualization implementation system and method based on Babylon and Cesium fusion
By integrating Babylon and Cesium engines in GIS systems and adopting camera synchronization technology, the problem of difficult integration of mapboxgl.js and cesium.js advantages in the existing technology is solved, and a more unified and efficient three-dimensional visual display is achieved.
Patent Information
- Application Number
- CN202510071706.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-30
AI Technical Summary
The existing technology is difficult to integrate the advantages of the two GIS systems, mapboxgl.js and cesium.js, together, resulting in the need to cut off a certain function or split it into two subsystems when displaying their respective specialties in the project, reducing the usability and unity of the project.
By integrating Babylon and Cesium engines in the engine integration layer and adopting camera synchronization technology, the camera position, direction and field of view between the two engines can be synchronized, and interaction and communication between the engines can be coordinated.
It realizes the effect of real-time synchronization in another engine when users operate in one engine, ensures the consistency of the camera, improves user experience and interactivity, and simplifies the development and usage process.
Smart Images

Figure CN120070783A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geographic information technology, and specifically to a three-dimensional visualization implementation system based on the integration of Babylon and Cesium, a three-dimensional visualization implementation method based on the integration of Babylon and Cesium, an electronic device, and a computer-readable storage medium. Background Art
[0002] The GIS system includes the mapboxgl.js GIS system and the cesium.js GIS system. With the development of business, different GIS systems often have their own advantages and benefits. In projects, it is often desired to present the benefits of both GIS systems to customers, but a single GIS system cannot fully achieve this. For example, the mapboxgl.js GIS system is good at loading special effects made by three.js. However, the cesium.js GIS system usually cannot load three.js special effects but is good at processing a large amount of oblique photography model data.
[0003] How to synchronize the data of both as a GIS system to load their respective specialized parts for use. Different GIS systems have different system internal parameters to describe their own camera positions, heights, pitch angles, and camera directions. If they need to be combined, many complex parameter conversions are required. There is no clear solution in the prior art. Often, a certain function is cut off and completed with a single system or split into two subsystems, which will reduce the usability and unity of the project. Therefore, the prior art needs to be improved. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a three-dimensional visualization implementation system and method based on the integration of Babylon and Cesium, which uses the Babylon and Cesium camera synchronization technology to achieve three-dimensional visualization integration, enabling the system to simultaneously possess the three-dimensional capabilities of a game engine and a GIS engine, so as to solve at least some of the technical problems in the background art.
[0005] To achieve the above purpose, the first aspect of this application provides a three-dimensional visualization implementation system based on the integration of Babylon and Cesium. The system includes: an engine integration layer, which integrates the Babylon engine and the Cesium engine and coordinates the interaction and communication between the engines; it also includes an engine initialization module, a scene construction module, a data conversion module, and a coordinate conversion module based on the engines; a data service layer, which renders the loaded satellite image data or three-dimensional real scene model data into the scene based on the engines in the engine integration layer; and a user interaction layer, which is used to provide the interaction function of the system, display page information to the user, provide interaction elements and control functions, and receive user operations.
[0006] Optionally, the data service layer includes: a data loading module for loading map data from a local file or a network service; a camera synchronization module for starting a camera synchronization mechanism after the data loading module finishes loading the map data; the camera synchronization mechanism for synchronizing parameter changes of a camera to a camera in another engine when the camera in one of the Babylon engine and the Cesium engine moves in response to an instruction, so as to maintain the consistency of the cameras in the two engines; an instruction interaction module for obtaining user operations of the user interaction layer and mapping the user operations into a standard form; and a real-time rendering module for performing scene rendering based on the cooperation of the Babylon engine and the Cesium engine according to the map data and the user operations.
[0007] Optionally, the camera synchronization module includes: a parameter acquisition sub-module for determining the position information of the camera by reading the geographical coordinates of the camera in the Cesium engine, and obtaining three direction vectors by reading the attributes and methods of the camera object in the Cesium engine to determine the direction information of the camera; a coordinate conversion sub-module for converting the geographical coordinates of Cesium into Cartesian coordinates of Babylon and making corresponding adjustments according to the differences in coordinate systems; a position, direction and perspective synchronization sub-module for realizing camera synchronization in different engines respectively from the camera position, camera direction and camera perspective; and a real-time update feedback sub-module for triggering the camera in another engine to update its own camera parameters in time when the parameter changes of the camera in one engine are monitored, and feeding back the real-time changes to the user.
[0008] Optionally, the position, direction and perspective synchronization sub-module includes: a position synchronization unit for applying the Cartesian coordinates obtained and converted from the camera in the Cesium engine to the position attribute of the camera in the Babylon engine to keep the camera positions synchronized; a direction synchronization unit for adjusting the direction vectors of the camera in the Cesium engine through a transformation matrix to match the coordinate system of Babylon and applying it to the rotation matrix or quaternion of the camera in the Babylon engine, so as to keep the camera directions synchronized; and a perspective synchronization unit for obtaining the perspective value from the camera in the Cesium engine and setting it to the camera in the Babylon engine to ensure the synchronization of the perspective ranges of the two.
[0009] In the second aspect of the present application, a three-dimensional visualization implementation method based on the integration of Babylon and Cesium is further provided. Based on the foregoing system, the method includes: presenting page information to the user through the user interaction layer and providing interaction elements and control functions; receiving user operations, and calling the engines in the engine integration layer to render the loaded satellite image data or three-dimensional real-scene model data into the scene; the engine integration layer integrates the Babylon engine and the Cesium engine, and coordinates the interaction and communication between the engines; it also includes functions such as engine initialization, scene construction, data conversion, and coordinate conversion based on the engines.
[0010] Optionally, receiving user operations, and calling the engines in the engine integration layer to render the loaded satellite image data or three-dimensional real-scene model data into the scene includes: loading map data from a local file or a network service; after the data loading module finishes loading the map data, starting a camera synchronization mechanism; the camera synchronization mechanism is used to synchronize the parameter changes of the camera to the camera in another engine when the camera in one of the Babylon engine and the Cesium engine moves in response to an instruction, so as to maintain the consistency of the cameras in the two engines; obtaining the user operations of the user interaction layer and mapping the user operations into a standard form; based on the collaborative work of the Babylon engine and the Cesium engine, performing scene rendering according to the map data and the user operations.
[0011] Optionally, starting the camera synchronization mechanism includes: determining the position information of the camera by reading the geographical coordinates of the camera in the Cesium engine, and obtaining three direction vectors by reading the attributes and methods of the camera object in the Cesium engine to determine the direction information of the camera; converting the geographical coordinates of Cesium into Cartesian coordinates of Babylon and making corresponding adjustments according to the differences in the coordinate systems; realizing camera synchronization in different engines respectively from the camera position, camera direction, and camera perspective; when the parameter changes of the camera in one engine are detected, triggering the camera in the other engine to update its own camera parameters in a timely manner and feeding back the real-time changes to the user.
[0012] Optionally, realizing camera synchronization in different engines respectively from the camera position, camera direction, and camera perspective includes: applying the Cartesian coordinates obtained and converted from the camera in the Cesium engine to the position attribute of the camera in the Babylon engine to keep the camera positions synchronized; adjusting the direction vectors of the camera in the Cesium engine through a transformation matrix to match the coordinate system of Babylon and applying it to the rotation matrix or quaternion of the camera in the Babylon engine, so as to keep the camera directions synchronized; obtaining the perspective value from the camera in the Cesium engine and setting it to the camera in the Babylon engine to ensure the synchronization of the perspective ranges of the two.
[0013] In the third aspect of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the foregoing three-dimensional visualization implementation method based on the fusion of Babylon and Cesium are implemented.
[0014] In the fourth aspect of the present application, a computer-readable storage medium is further provided. Instructions are stored in the storage medium. When it runs on a computer, the computer is made to execute the steps of the foregoing three-dimensional visualization implementation method based on the fusion of Babylon and Cesium.
[0015] In the fifth aspect of the present application, a computer program product is provided, including a computer program which, when executed by a processor, implements the foregoing three-dimensional visualization implementation method based on the fusion of Babylon and Cesium.
[0016] The above technical solutions have at least the following beneficial effects:
[0017] (1) Consistent perspective experience. Operations by the user in one engine are synchronously updated in real time to the other engine, ensuring that the camera position, orientation, and field of view are consistent between the two engines. In this way, no matter which engine the user operates in, a consistent perspective experience can be obtained, reducing user confusion and perplexity.
[0018] (2) Enhanced interactivity. The synchronization technology enables the user to operate in one engine while seeing the results in real time in the other engine. This real-time feedback mechanism enhances user interactivity, enabling the user to more intuitively understand and control geographical information.
[0019] (3) Improved user experience. By implementing camera synchronization, the user can switch between different engines more smoothly and without having to adjust the perspective, greatly improving the user experience. The user can explore geographical information more freely and experience a more immersive experience.
[0020] (4) Simplified development and usage processes. For developers, adopting camera synchronization technology can simplify the system development process and reduce data transmission and adaptation work between different engines. For users, this technology eliminates the need to switch back and forth between different engines, simplifying the usage process and improving efficiency.
[0021] (5) Enhanced scalability and flexibility. Camera synchronization technology can be flexibly applied to various different application scenarios and system architectures. Whether it is a single application or a complex distributed system, camera synchronization can be implemented to improve the scalability and flexibility of the system and meet the needs of different users.
[0022] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific embodiments section. Brief Description of the Drawings
[0023] The drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present application, but do not constitute a limitation to the embodiments of the present application. In the drawings:
[0024] Figure 1 Schematically shows a structural diagram of a three-dimensional visualization implementation system based on the integration of Babylon and Cesium according to an embodiment of the present application;
[0025] Figure 2 Schematically shows an application environment diagram of a three-dimensional visualization implementation system based on the integration of Babylon and Cesium according to an embodiment of the present application;
[0026] Figure 3 Schematically shows a step diagram of a three-dimensional visualization implementation method based on the integration of Babylon and Cesium according to an embodiment of the present application;
[0027] Figure 4 Schematically shows an internal structure diagram of a computer device according to an embodiment of the present application. Detailed Description of the Embodiments
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to illustrate and explain the embodiments of the present application and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.
[0029] It should be noted that if there are directional indications (such as up, down, left, right, front, back...) involved in the embodiments of the present application, the directional indications are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indications will also change accordingly.
[0030] In addition, if the description involves "first", "second", etc. in the embodiments of the present application, such descriptions of "first", "second", etc. are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between various embodiments may be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0031] In the technical solution of the present application, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.
[0032] Figure 1 Schematically shows a schematic structural diagram of a three-dimensional visualization implementation system based on the integration of Babylon and Cesium according to an embodiment of the present application. As Figure 1 shown, a three-dimensional visualization implementation system based on the integration of Babylon and Cesium, the system includes:
[0033] An engine integration layer, which integrates the Babylon engine and the Cesium engine and coordinates the interaction and communication between the engines; it also includes an engine initialization module, a scene construction module, a data conversion module, and a coordinate conversion module based on the engines;
[0034] A data service layer, which renders the loaded satellite image data or three-dimensional real scene model data into the scene based on the engines in the engine integration layer; and
[0035] A user interaction layer, which is used to provide the interaction function of the system, display page information to the user, provide interaction elements and control functions, and receive user operations.
[0036] This system is based on the integration of the Babylon and Cesium engines, aiming to provide a three-dimensional geographic information display platform with high interactivity and visual rendering effects. Through the camera synchronization technology, the system realizes the synchronization of the camera position, direction, and field of view between the two engines. Users can operate in one engine and see the corresponding changes in real time in the other engine. The main functions of the system include map data loading, camera synchronization, user interaction, real-time rendering, and data feedback. Users can access the system through a web page or an application program, browse the three-dimensional model of the earth in real time, and interact with the map. The system supports operations such as dragging, zooming, and rotating by users, and at the same time provides rich map data and layers for selection. During the operation of users, the system can update the map in real time and feedback the results to users to maintain the coherence and fluency of the user experience.
[0037] The overall system uses the Babylon and Cesium camera synchronization technology to achieve three-dimensional visualization fusion, enabling the system to possess the three-dimensional capabilities of both game engines and GIS engines. Among them, Babylon is one of the most powerful, aesthetically pleasing, simplest, and most open Web rendering engines in the game engine field; CesiumJS is an open-source JavaScript library used to create world-class 3D globes and maps with the best performance, accuracy, visual quality, and ease of use. This system combines the two to achieve the function of presenting highly realistic and rich three-dimensional earth scenes, including features such as images, buildings, and water bodies, bringing users a more immersive and interactive three-dimensional visualization experience and providing strong support and practical value for various application scenarios.
[0038] Figure 2 Schematically shows an application environment diagram of a three-dimensional visualization implementation system based on the fusion of Babylon and Cesium according to an embodiment of the present application. As Figure 2 shown, the three-dimensional visualization implementation system based on the fusion of Babylon and Cesium provided by the present application can be applied to the application environment as Figure 2 shown. Among them, the terminal 102 communicates with the server 104 through the network. Among them, the terminal 102 is used by the user and is usually the initiator of the demand. It can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, on which the aforementioned three-dimensional visualization implementation system based on the fusion of Babylon and Cesium runs.
[0039] In some embodiments of the present application, the data service layer includes: a data loading module for loading map data from local files or network services; a camera synchronization module for starting a camera synchronization mechanism after the data loading module finishes loading the map data; the camera synchronization mechanism for synchronizing the parameter changes of the camera to the camera in the other engine when the camera in one of the Babylon engine and the Cesium engine moves in response to an instruction, so as to maintain the consistency of the cameras in the two engines; an instruction interaction module for obtaining user operations in the user interaction layer and mapping the user operations into a standard form; and a real-time rendering module for rendering scenes based on the collaborative work of the Babylon engine and the Cesium engine according to the map data and user operations.
[0040] In some embodiments of the present application, the camera synchronization module includes: a parameter acquisition sub-module, which is used to determine the position information of the camera by reading the geographical coordinates of the camera in the Cesium engine, and obtain three direction vectors by reading the attributes and methods of the camera object in the Cesium engine to determine the direction information of the camera. This sub-module first needs to obtain the current position information and direction information from the Cesium camera. The position of the Cesium camera is usually represented by geographical coordinates, namely longitude, latitude and altitude. The camera object of Cesium contains attributes and methods, and these information can be directly obtained. In addition, the direction information of the camera includes three key vectors: the direction vector, the up direction vector and the right direction vector. These vectors describe the orientation, top orientation and right orientation of the camera, corresponding to the direction, up and right attributes of the Cesium camera respectively. A coordinate conversion sub-module, which is used to convert the geographical coordinates of Cesium into the Cartesian coordinates of Babylon and make corresponding adjustments according to the differences in the coordinate systems; Since Cesium and Babylon use different coordinate systems, this sub-module must be used for coordinate conversion. Cesium uses a geographical coordinate system (longitude, latitude, altitude) and a geocentric Cartesian coordinate system, while Babylon uses a right-handed Cartesian coordinate system. In order to synchronize the camera position, it is necessary to convert the geographical coordinates of Cesium into the Cartesian coordinates of Babylon. This is usually achieved through the conversion methods provided by Cesium, such as Cartesian3.fromDegrees, which converts longitude, latitude and altitude into Cartesian coordinates. In addition, the differences between the Cesium and Babylon coordinate systems need to be considered and necessary adjustments are made to ensure the correct coordinate conversion. A position, direction and perspective synchronization sub-module, which is used to achieve camera synchronization in different engines from the camera position, camera direction and camera perspective respectively; Synchronizing the camera position, direction and perspective is a key step to ensure that Cesium and Babylon present a consistent view. This sub-module applies the obtained and converted Cartesian coordinates from Cesium to the position attribute of the Babylon camera to make their positions consistent. Then, the direction vector of the Cesium camera is adjusted through a transformation matrix to match the coordinate system of Babylon and applied to the rotation matrix or quaternion of the Babylon camera, thereby synchronizing the camera direction. Finally, the perspective value is obtained from the Cesium camera and set to the Babylon camera to ensure that their perspective ranges are the same. These synchronization operations make the cameras in two different 3D engines consistent in position, direction and perspective, providing a unified user experience and rendering effect. And a real-time update feedback sub-module, which is used to trigger the camera in another engine to update its own camera parameters in time when the parameters of the camera in one engine are monitored to change, and feedback the real-time changes to the user.This sub-module is used to ensure the real-time update and feedback of camera parameters to achieve real-time camera synchronization. When the camera parameters in one engine change, the other engine needs to update its own camera parameters in a timely manner and feedback the changes to the user to ensure that the user can perceive the camera synchronization effect.
[0041] Through the mutual cooperation of each sub-module in the camera synchronization module, the camera synchronization technology between Babylon and Cesium can be realized, ensuring that the camera positions, orientations, and fields of view between them are consistent, thereby achieving a seamless geographical information display and interactive experience.
[0042] In some embodiments of the present application, the position-orientation-view synchronization sub-module includes: a position synchronization unit for applying the Cartesian coordinates obtained and converted from the camera in the Cesium engine to the position attribute of the camera in the Babylon engine to keep the camera positions synchronized; an orientation synchronization unit for adjusting the direction vector of the camera in the Cesium engine through a transformation matrix to match the coordinate system of Babylon and applying it to the rotation matrix or quaternion of the camera in the Babylon engine to keep the camera orientations synchronized; and a view synchronization unit for obtaining the view value from the camera in the Cesium engine and setting it to the camera in the Babylon engine to ensure that the view ranges of both are synchronized.
[0043] For the specific definitions of each functional module in the above three-dimensional visualization implementation system based on the integration of Babylon and Cesium, reference can be made to the definitions of the three-dimensional visualization implementation method based on the integration of Babylon and Cesium in the text, which will not be elaborated here. Each module in the above device or system can be implemented in whole or in part by software, hardware, and their combinations. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form for the processor to call and execute the operations corresponding to the above respective modules. This system is applied to the three-dimensional visualization implementation based on the integration of Babylon and Cesium, and also realizes the engine integration, with the advantage of better three-dimensional visualization effect.
[0044] Based on the same inventive concept, a three-dimensional visualization implementation method based on the integration of Babylon and Cesium is also provided, which is implemented based on the aforementioned system. Figure 3 Schematically shows the step diagram of the three-dimensional visualization implementation method based on the integration of Babylon and Cesium according to the embodiments of the present application. As Figure 3 shown, the method includes:
[0045] S01. Display page information to the user through the user interaction layer and provide interaction elements and control functions;
[0046] S02. Receive a user operation and call the engine in the engine integration layer to render the loaded satellite image data or 3D real scene model data into the scene;
[0047] The engine integration layer integrates the Babylon engine and the Cesium engine, and coordinates the interaction and communication between the engines; it also includes functions such as engine initialization, scene construction, data conversion, and coordinate conversion based on the engines.
[0048] In some alternative embodiments of the present application, receiving a user operation and calling the engine in the engine integration layer to render the loaded satellite image data or 3D real scene model data into the scene includes: loading map data from a local file or a network service; after the data loading module finishes loading the map data, starting a camera synchronization mechanism; the camera synchronization mechanism is used to synchronize the parameter changes of the camera to the camera in another engine when the camera in one of the Babylon engine and the Cesium engine moves in response to an instruction, so as to maintain the consistency of the cameras in the two engines; obtaining the user operation of the user interaction layer and mapping the user operation into a standard form; based on the collaborative work of the Babylon engine and the Cesium engine, performing scene rendering according to the map data and the user operation.
[0049] In some alternative embodiments of the present application, starting the camera synchronization mechanism includes: determining the position information of the camera by reading the geographical coordinates of the camera in the Cesium engine, and obtaining three direction vectors by reading the attributes and methods of the camera object in the Cesium engine to determine the direction information of the camera; converting the geographical coordinates of Cesium into Cartesian coordinates of Babylon and making corresponding adjustments according to the differences in the coordinate systems; realizing camera synchronization in different engines respectively from the camera position, camera direction, and camera perspective; when it is detected that the parameters of the camera in one engine change, triggering the camera in the other engine to update its own camera parameters in a timely manner and feedback the real-time changes to the user.
[0050] In some alternative embodiments of the present application, realizing camera synchronization in different engines respectively from the camera position, camera direction, and camera perspective includes: applying the obtained and converted Cartesian coordinates from the camera in the Cesium engine to the position attribute of the camera in the Babylon engine to keep the camera positions synchronized; adjusting the direction vector of the camera in the Cesium engine through a transformation matrix to match the coordinate system of Babylon and applying it to the rotation matrix or quaternion of the camera in the Babylon engine, so as to keep the camera directions synchronized; obtaining the perspective value from the camera in the Cesium engine and setting it to the camera in the Babylon engine to ensure that the perspective ranges of the two are synchronized.
[0051] The following embodiments provide and introduce the process for users to access the final model rendering. Users access the web page or application. Specifically, the ways include that users access the system integrating Babylon and Cesium through a browser or an application. Exemplarily, it includes the following steps:
[0052] (1) System initialization: When the user accesses the system, the system first performs initialization. This includes operations such as loading necessary resources, configuring camera parameters, and establishing data connections.
[0053] (2) Map data loading: The system starts to load map data, including terrain data, satellite images, buildings, etc. This data can come from local files or web services.
[0054] (3) Camera synchronization: Once the map data is loaded, the system starts the camera synchronization mechanism. When the user moves the camera in one engine, the system synchronizes the camera parameters to the other engine to maintain the consistency of the viewing angle.
[0055] (4) User interaction: Users can interact with the system through devices such as a mouse, keyboard, or touch screen. They can drag, zoom, rotate on the map, select marker points or layers, etc.
[0056] (5) Real-time rendering: When the user performs interactions, the system updates the display of the map in real time according to the user's operations. The Babylon and Cesium engines work together to render the scene based on the map data and the user's operations.
[0057] (6) Data feedback: The rendering result is fed back to the user in real time. Users can see the latest map display effect on the page or in the application. They can intuitively feel the changes in geographical information and the interaction effects.
[0058] (7) Continuous interaction and experience: Users can continuously interact with the system, explore different parts of the map, and understand the relevant content of geographical information. The system will continuously perform real-time rendering and feedback according to the user's operations to maintain the coherence and fluency of the user experience.
[0059] Through the above process, users can smoothly access the final model rendering result, and can perceive the changes and effects of the map in real time during the interaction process, thus obtaining a better user experience.
[0060] The system or method in this application is preferably applied in the energy industry, bringing a modern and more attractive appearance to energy three-dimensional visualization products, enhancing the user experience, and enabling users to enjoy a more immersive three-dimensional visualization experience.
[0061] An embodiment of the present application provides a storage medium, on which a program is stored, and when the program is executed by a processor, it implements the above-mentioned three-dimensional visualization implementation system based on the integration of Babylon and Cesium or the three-dimensional visualization implementation method based on the integration of Babylon and Cesium.
[0062] In one embodiment, an electronic device is provided, preferably a computer device, and the computer device may be a server, and its internal structure diagram may be as Figure 4 shown. Figure 4 The internal structure diagram of the computer device according to the embodiment of the present application is schematically shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure), and a database (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02, and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, it implements a three-dimensional visualization implementation method based on the integration of Babylon and Cesium.
[0063] Those skilled in the art can understand that Figure 4 the structure shown in
[0064] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout. Figure 4 In one embodiment, the three-dimensional visualization implementation system based on the integration of Babylon and Cesium provided by the present application can be implemented in the form of a computer program, and the computer program can run on a computer device as
[0065] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0066] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0067] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0068] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0069] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.
[0070] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0071] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0072] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0073] The above is only the implementation mode of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A 3D visualization implementation system based on the fusion of Babylon and Cesium, characterized in that: The system includes: The engine integration layer integrates the Babylon engine and the Cesium engine, and coordinates the interaction and communication between the engines; it also includes the engine initialization module, scene construction module, data conversion module, and coordinate conversion module based on the engine; The data service layer renders the loaded satellite image data or three-dimensional real scene model data into the scene based on the engine in the engine integration layer; and The user interaction layer is used to provide the interactive functions of the system, display page information to users, provide interactive elements and control functions, and receive user operations.
2. The system according to claim 1, characterized in that The data service layer includes: Data loading module, used to load map data from local files or network services; A camera synchronization module, used to start a camera synchronization mechanism after the data loading module has finished loading the map data; the camera synchronization mechanism is used to synchronize the camera parameter changes to the camera in the other engine when the camera in one of the Babylon engine and the Cesium engine moves in response to an instruction, so as to maintain the consistency of the cameras in the two engines; An instruction interaction module, used to obtain user operations at the user interaction layer and map the user operations into a standard form; and The real-time rendering module is used to work together with the Babylon engine and the Cesium engine to render scenes based on map data and user operations.
3. The system according to claim 2, characterized in that The camera synchronization module comprises: The parameter acquisition submodule is used to determine the location information of the camera by reading the geographic coordinates of the camera in the Cesium engine, and obtain three direction vectors by reading the properties and methods of the camera object in the Cesium engine to determine the direction information of the camera; The coordinate conversion submodule is used to convert Cesium's geographic coordinates into Babylon's Cartesian coordinates and make corresponding adjustments based on the differences in the coordinate systems; The position, direction and perspective synchronization submodule is used to realize camera synchronization in different engines from the perspective of camera position, camera direction and camera perspective respectively; and The real-time update feedback submodule is used to monitor the parameter changes of the camera in one engine, trigger the camera in another engine to update its own camera parameters in time, and feed back the real-time changes to the user.
4. The system according to claim 3, characterized in that The position direction and viewing angle synchronization submodule includes: The position synchronization unit is used to apply the Cartesian coordinates obtained and converted from the camera in the Cesium engine to the position attributes of the camera in the Babylon engine to keep the camera position synchronized; The direction synchronization unit is used to adjust the direction vector of the camera in the Cesium engine through the transformation matrix to match the Babylon coordinate system, and apply it to the rotation matrix or quaternion of the camera in the Babylon engine to keep the camera direction synchronized; and The perspective synchronization unit is used to obtain the perspective value from the camera in the Cesium engine and set it to the camera in the Babylon engine to ensure that the perspective ranges of the two are synchronized.
5. A three-dimensional visualization implementation method based on the fusion of Babylon and Cesium, based on the system according to any one of claims 1 to 4, characterized in that: The method includes: Display page information to users through the user interaction layer and provide interactive elements and control functions; Receiving user operations through the user interaction layer, calling the engine in the engine integration layer to render the loaded satellite image data or three-dimensional real scene model data into the scene; The engine integration layer integrates the Babylon engine and the Cesium engine, and coordinates the interaction and communication between the engines; it also includes the following engine-based functions: engine initialization, scene construction, data conversion, and coordinate conversion.
6. The method according to claim 5, characterized in that Receive user operations and call the engine in the engine integration layer to render the loaded satellite image data or 3D real scene model data into the scene, including: Load map data from local files or network services; After the data loading module completes loading the map data, a camera synchronization mechanism is started; the camera synchronization mechanism is used to synchronize the parameter changes of the camera to the camera in the other engine when the camera in one of the Babylon engine and the Cesium engine moves in response to an instruction, so as to maintain the consistency of the cameras in the two engines; Acquire user operations at the user interaction layer, and map the user operations into a standard form; Based on the collaboration between the Babylon engine and the Cesium engine, scenes are rendered based on map data and user operations.
7. The method according to claim 6, characterized in that The starting camera synchronization mechanism includes: The camera's location information is determined by reading the camera's geographic coordinates in the Cesium engine, and the three direction vectors are obtained by reading the properties and methods of the camera object in the Cesium engine to determine the camera's direction information; Convert Cesium geographic coordinates to Babylon Cartesian coordinates, adjusting for differences in coordinate systems; Realize camera synchronization in different engines from the perspective of camera position, camera direction and camera perspective; When the parameter changes of the camera in one engine are detected, the camera in another engine is triggered to update its own camera parameters in time and feedback the real-time changes to the user.
8. The method according to claim 7, characterized in that The camera position, direction and view angle of the camera are used to synchronize cameras in different engines, including: Apply the converted Cartesian coordinates obtained from the camera in the Cesium engine to the position properties of the camera in the Babylon engine to keep the camera positions synchronized; Adjust the direction vector of the camera in the Cesium engine through the transformation matrix to match the Babylon coordinate system, and apply it to the rotation matrix or quaternion of the camera in the Babylon engine to keep the camera direction synchronized; Get the view value from the camera in the Cesium engine and set it to the camera in the Babylon engine to ensure that the view ranges of the two are synchronized.
9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the three-dimensional visualization implementation method based on the fusion of Babylon and Cesium as described in any one of claims 5 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the three-dimensional visualization implementation method based on the fusion of Babylon and Cesium as described in any one of claims 5 to 8.
Citation Information
Cited By
Cross-rendering engine fusion method based on nonlinear coordinate correction
CN121235963A
Cross-rendering engine fusion method based on nonlinear coordinate correction
CN121235963B