A method and system for three-dimensional simulation data three-level linkage processing and display
By preprocessing and hierarchical structure construction of 3D simulation data, and adopting an octree structure and a three-level linkage mechanism, the problem of mismatch between data resolution and display scale in multi-view display is solved, realizing the matching of data volume and view display requirements and multi-scale visualization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AEROSPACE SCI & IND INTELLIGENT OPERATION RES & INFORMATION SECURITY RES INST (WUHAN) CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-06-02
Smart Images

Figure CN122134915A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graphics processing technology, and in particular to a method and system for three-dimensional simulation data three-level linkage processing and display. Background Technology
[0002] 3D simulation technology is widely used in fields such as engineering design, scientific computing, medical imaging, and virtual reality. It generates large amounts of 3D simulation data containing spatial grid points and physical field values through numerical simulation. As the scale of simulations continues to increase, 3D simulation data often has the characteristics of large volume and high resolution. It is necessary to enable multi-scale browsing and detailed exploration during interactive display to meet users' observation needs from overall overview to local magnification and then to fine details.
[0003] In existing technologies, multi-view parallel display is commonly used to interactively display 3D simulation data. Some technical solutions establish global views, local views, and detail views, and load 3D simulation data of the same resolution into different views for rendering. Other technical solutions introduce a hierarchical detail mechanism, but the views are independent of each other. When the user selects an area or adjusts the camera in one view, other views need to be manually synchronized, or only one-way linkage is achieved, resulting in insufficient coordination between views.
[0004] However, in the process of implementing the technical solution of this application, the inventors of this application discovered that the above-mentioned technology has at least the following technical problems: When displaying three-dimensional simulation data in multiple views, the resolution of the data loaded in each view does not match the current display scale, so it is impossible to match the data volume with the display requirements of different scale views, which affects the hierarchical management of data processing. Summary of the Invention
[0005] To overcome the above shortcomings, this invention provides a method and system for three-level linkage processing and display of three-dimensional simulation data, aiming to improve the problem in the existing technology where the data resolution loaded in each view does not match the current display scale when displaying three-dimensional simulation data in multiple views, thus failing to match the data volume with the display requirements of views at different scales.
[0006] In a first aspect, the present invention provides the following technical solution: a method for three-dimensional simulation data three-level linkage processing and display, comprising the following steps:
[0007] The input 3D simulation data is preprocessed and a hierarchical structure is constructed to obtain an octree structure;
[0008] Define the global view, local view, and detail view, and set the camera parameters for each view;
[0009] A three-level linkage mechanism is triggered by user interaction events to achieve synchronous updates of the global view, local view, and detail view. The three-level linkage mechanism includes global-to-local linkage, local-to-detail linkage, and reverse linkage and synchronization.
[0010] Based on the current camera parameters of each view, data blocks of the corresponding resolution are extracted from the octree structure, and data sampling and rendering are performed in parallel in three independent viewports.
[0011] Preferably, the steps of preprocessing and hierarchical structure construction of the input 3D simulation data include:
[0012] The spatial domain corresponding to the 3D simulation data is divided into a multi-level mesh structure;
[0013] An octree structure is used to manage the multi-level grid structure;
[0014] When constructing the octree structure, the space is recursively subdivided starting from the root node, so that octree nodes at different levels correspond to data blocks of different spatial scales.
[0015] The grid data and field value data at the corresponding scale are stored in the corresponding octree nodes.
[0016] Preferably, the step of defining a global view, a local view, and a detail view, and setting camera parameters for each view, includes:
[0017] Set the camera in the global view to cover the entire simulation space.
[0018] The camera position of the partial view and detail view is dynamically adjusted based on the user's selection.
[0019] Set the viewing direction and view frustum parameters for each view;
[0020] The 3D simulation data is projected and transformed to convert the 3D coordinates into screen coordinates for display.
[0021] Preferably, the steps of global-to-local linkage in the three-level linkage mechanism include:
[0022] Users select areas of interest in the global view;
[0023] Define the bounding box based on the region of interest selected by the user;
[0024] The camera parameters are adjusted in the local view, including calculating the center of the bounding box, determining the viewing direction, and calculating the distance from the camera to the center, so that the view frustum surrounds the bounding box;
[0025] Display the bounding box in the global view.
[0026] Preferably, the steps of the local-to-detail linkage in the three-level linkage mechanism include:
[0027] Users select a sub-region in the partial view;
[0028] Define a smaller bounding box based on the sub-region selected by the user;
[0029] The detailed view adjusts camera parameters, including calculating the smaller bounding box center, determining the viewing direction, and calculating the distance from the camera to the center, so that the view frustum surrounds the smaller bounding box;
[0030] Display the smaller bounding box in the partial view;
[0031] Display nested bounding boxes in the global view.
[0032] Preferably, the reverse linkage and synchronization steps in the three-level linkage mechanism include:
[0033] When a user pans the camera in a local view or detail view, the position of the corresponding spatial boundary range is updated synchronously, while the camera parameters of the global view remain unchanged.
[0034] When a user rotates the camera in a partial view or detail view, a quaternion is used to represent the current rotation state.
[0035] The incremental quaternion is calculated based on the rotation increment, and the current quaternion is multiplied by the incremental quaternion to obtain the updated quaternion;
[0036] The corresponding spatial boundary range is updated synchronously based on the updated quaternion.
[0037] Preferably, the step of extracting data blocks of corresponding resolution from the octree structure includes:
[0038] Select low-resolution data for the global view;
[0039] Select medium-resolution data for the partial view;
[0040] Select high-resolution data for the detail view;
[0041] Based on the current camera parameters of each view, the required data resolution is determined, and the corresponding data is selected from the hierarchical spatial data structure.
[0042] Preferably, the steps of data sampling and rendering include:
[0043] Calculate the required level of detail based on the view distance and screen resolution;
[0044] Based on the calculated level of detail, select the corresponding node data from the octree structure;
[0045] Perform volume rendering or surface rendering on the selected node data;
[0046] Visualize field values, including using transfer functions to map scalar values to color and opacity.
[0047] Preferably, the step of rendering in parallel in three independent viewports includes:
[0048] The rendering process is executed separately in different viewports via a graphical interface;
[0049] The rendering results of the corresponding view are displayed in real time in the viewport to achieve multi-scale linkage display.
[0050] Secondly, the present invention provides the following technical solution: a system for three-dimensional simulation data three-level linkage processing and display, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
[0051] The present invention has the following beneficial effects:
[0052] 1. This invention obtains an octree structure by preprocessing and hierarchically constructing the input 3D simulation data, and extracts data blocks of corresponding resolution from the octree structure according to the current camera parameters of each view, thereby loading and displaying the amount of data matching the requirements in different scale views, and realizing hierarchical management of data processing.
[0053] 2. This invention defines a global view, a local view, and a detail view, and sets camera parameters. Combined with a user interaction event-triggered three-level linkage mechanism, it enables the camera parameters of the corresponding view to be automatically adjusted and the bounding box position to be updated when the user selects an area of interest or a sub-area, thus realizing coordinated interaction between the three views.
[0054] 3. This invention calculates the required level of detail based on the view distance and screen resolution, samples the data, and uses a transfer function to map scalar values to color and opacity before rendering in parallel in three independent viewports. Combined with the graphics API to execute the rendering pipeline, it realizes multi-scale visualization of 3D simulation data. Attached Figure Description
[0055] Figure 1 This invention proposes a method and system for three-dimensional simulation data three-level linkage processing and display, and a three-level linkage display diagram of global, local and detailed data.
[0056] Figure 2 This is a schematic diagram illustrating the collaborative situation of two-dimensional and three-dimensional views in a method and system for three-dimensional simulation data three-level linkage processing and display proposed in this invention.
[0057] Figure 3 This invention presents a method and system for three-dimensional simulation data three-level linkage processing and display, and a diagram illustrating the shared memory information collaboration mechanism. Detailed Implementation
[0058] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] Example 1
[0060] Reference Figures 1-3 In the first embodiment of the present invention, the present invention provides a method for three-dimensional simulation data three-level linkage processing and display, including the following steps:
[0061] The input 3D simulation data is preprocessed and a hierarchical structure is constructed to obtain an octree structure;
[0062] Define the global view, local view, and detail view, and set the camera parameters for each view;
[0063] A three-level linkage mechanism is triggered by user interaction events to achieve synchronous updates of the global view, local view, and detail view. The three-level linkage mechanism includes global-to-local linkage, local-to-detail linkage, and reverse linkage and synchronization.
[0064] Based on the current camera parameters of each view, data blocks of the corresponding resolution are extracted from the octree structure, and data sampling and rendering are performed in parallel in three independent viewports.
[0065] Specifically, the process of preprocessing and hierarchical structure construction of the input 3D simulation data includes: obtaining the spatial domain Ω corresponding to the 3D simulation data. The spatial domain Ω is determined by the coordinate range in the 3D Cartesian coordinate system, and is represented as:
[0066] ;
[0067] in, , , , , , These represent the minimum and maximum values of the 3D simulation data in the three coordinate axes, respectively.
[0068] In the spatial domain Inside, with An octree structure is constructed, representing the spatial region corresponding to the root node. Each node of the octree corresponds to an axis-aligned cubic spatial region, the boundaries of which are determined by the upper and lower bounds of the spatial region corresponding to that node along the three-dimensional coordinate axes. For any octree node, when its corresponding spatial region satisfies a preset subdivision condition, the spatial region is divided equally along the x-axis, y-axis, and z-axis, resulting in eight sub-spatial regions, which are then used as child nodes of that node. The subdivision condition includes at least one of the following:
[0069] The side length of the spatial region corresponding to the current node is greater than the preset minimum spatial resolution threshold;
[0070] The number of simulation data points contained in the current node is greater than the preset data volume threshold;
[0071] The change in the simulated field value within the spatial region corresponding to the current node is greater than the preset change threshold.
[0072] During the octree construction process, for each node, a simulation data block corresponding to the spatial region of that node is stored. The simulation data block includes at least one of the following information: boundary parameters of the node's spatial region, node level identifier, mesh data within that spatial region, and corresponding simulation field value data. The simulation field value data are scalar or vector values defined at three-dimensional spatial locations, used to describe the distribution of physical quantities.
[0073] Through the recursive subdivision process described above, a multi-level octree structure is formed from the root node to the leaf nodes. Nodes closer to the root node correspond to data blocks with larger spatial scales and lower spatial resolutions, while nodes closer to the leaf nodes correspond to data blocks with smaller spatial scales and higher spatial resolutions. This achieves hierarchical organization of 3D simulation data in terms of spatial scale.
[0074] In the subsequent data selection process, for any view, the spatial region of interest is determined based on the camera parameters corresponding to that view. Using this spatial region as the query condition, a set of nodes covering the spatial region and whose levels meet the resolution requirements is selected in the octree structure. The corresponding data blocks are then obtained from the node set for data sampling and rendering processing of that view.
[0075] Through the above steps, the preprocessing of 3D simulation data and the construction of a hierarchical spatial data structure based on an octree were achieved, providing basic data support for subsequent multi-view linkage, resolution-adaptive data selection, and rendering display.
[0076] Furthermore, the steps of preprocessing and hierarchical structure construction of the input 3D simulation data include:
[0077] The spatial domain corresponding to the 3D simulation data is divided into a multi-level mesh structure;
[0078] An octree structure is used to manage the multi-level grid structure;
[0079] When constructing the octree structure, the space is recursively subdivided starting from the root node, so that octree nodes at different levels correspond to data blocks of different spatial scales.
[0080] The grid data and field value data at the corresponding scale are stored in the corresponding octree nodes.
[0081] Specifically, the 3D simulation data includes at least spatial coordinate data and simulation field value data corresponding to the spatial coordinates. The simulation field value data is used to represent the physical quantity values at each spatial location. First, based on the value range of the 3D simulation data along the 3D coordinate axes, the overall spatial domain corresponding to the 3D simulation data is determined, and this overall spatial domain is used as the initial spatial unit of the hierarchical spatial data structure.
[0082] Within the overall spatial domain, a multi-level grid structure is constructed according to preset spatial partitioning rules. The multi-level grid structure is divided sequentially from largest to smallest spatial scale, with different levels of grids corresponding to different spatial resolutions. Higher-level grids cover a larger spatial area and have lower spatial resolution, while lower-level grids cover a smaller spatial area and have higher spatial resolution. Grids at each level are spatially contained to ensure consistency in multi-scale spatial representation.
[0083] When managing multi-level grid structures, an octree structure is used as the hierarchical spatial data structure. The root node of the octree corresponds to the overall spatial domain, and each node in the octree corresponds to an axis-aligned spatial region. For any octree node, when the spatial region corresponding to the node meets the preset subdivision conditions, the spatial region is divided into two equal parts along the three coordinate axes, thereby generating eight sub-space regions, which are then used as the child nodes of the current node.
[0084] The subdivision criteria are used to control the depth and spatial resolution of the octree hierarchy, and must include at least one of the following conditions: the side length of the spatial region corresponding to the current node is greater than a preset minimum spatial size threshold; the number of simulation data points contained in the spatial region covered by the current node is greater than a preset data point number threshold; the range of numerical variation of the simulation field values in the spatial region covered by the current node is greater than a preset variation threshold. By judging the subdivision criteria, the termination condition of the octree recursive subdivision is limited, thereby determining the spatial scale corresponding to each node.
[0085] During the construction of the octree, for each octree node, a spatial data block corresponding to the node is established. The spatial data block at least includes the boundary parameters of the spatial region of the node, the level identifier of the node, and the grid data and simulation field value data within the spatial region. Among them, the grid data is used to describe the spatial discrete structure of the simulation data within the spatial region, and the simulation field value data is the numerical information corresponding to the grid data.
[0086] Through the above recursive partitioning and data storage process, an octree structure that is refined level by level from the root node to the leaf nodes is formed, such that octree nodes at different levels respectively correspond to data blocks with different spatial scales and different resolutions. Thus, the multi-scale spatial organization of three-dimensional simulation data is achieved, enabling the rapid positioning and acquisition of data blocks corresponding to the corresponding scales from the octree structure according to the requirements of different views for spatial scales and resolutions during subsequent processing, providing a clear data basis for the data selection and rendering processing of multi-view linkage.
[0087] Furthermore, the steps of defining the global view, local view, and detail view and setting camera parameters for each view include:
[0088] Set the camera of the global view to be able to cover the entire simulation space range;
[0089] Dynamically adjust the camera positions of the local view and detail view according to the user's selection results;
[0090] Set the viewing direction and frustum parameters for each view respectively;
[0091] Perform projection transformation on the three-dimensional simulation data to convert the three-dimensional coordinates into screen coordinates for display.
[0092] Specifically, the multiple linked views at least include the global view, local view, and detail view. Each view is logically independent and corresponds to an independent viewport area. For each view, a set of camera parameters is established to describe the mapping relationship of the three-dimensional simulation data to the two-dimensional display plane under that view. The camera parameters at least include the camera position vector, viewing direction vector, up direction vector, field of view angle parameter, near clipping plane distance, and far clipping plane distance.
[0093] In the global view, the camera position is determined according to the overall spatial domain corresponding to the three-dimensional simulation data. Specifically, according to the boundary range of the spatial domain in the three-dimensional coordinate axes directions, calculate the geometric center point of the spatial domain, and use this geometric center point as the viewing target point of the global view; the camera position is set at a predetermined distance outside the viewing target point, and this distance is associated with the maximum spatial scale of the spatial domain to ensure that the frustum of the global view can completely cover the entire simulation space range.
[0094] In partial and detail views, camera parameters are dynamically adjusted based on user selections. When a user selects a spatial region in a low-scale view, the center point of that boundary region is calculated and used as the observation target point in the partial or detail view. Simultaneously, the distance between the camera and the center point is calculated based on the spatial dimensions of the boundary region, ensuring that the view frustum of the corresponding view completely encloses the boundary region while satisfying near and far clipping plane constraints.
[0095] For each view, the camera's viewing direction is determined by the camera position pointing to the corresponding target point, and the up direction vector is used to constrain the view's pose direction. The view frustum parameters include the field of view angle, near clipping plane distance, and far clipping plane distance. The field of view angle is used to limit the opening angle of the view frustum, while the near and far clipping plane distances are used to limit the visible space range, thereby culling data located outside the view frustum during subsequent rendering.
[0096] Before display, a projection transformation is performed on the 3D simulation data. The projection transformation consists of two stages: model-view transformation and projection transformation. The model-view transformation converts the coordinates of the 3D simulation data in the world coordinate system to coordinates in the camera coordinate system, expressed as:
[0097] ;
[0098] in, This represents the homogeneous coordinate vector of a 3D simulation data point in the world coordinate system. Represents the model-view transformation matrix. This represents the homogeneous coordinate vector in the camera coordinate system after the transformation.
[0099] After completing the model-view transformation, a projection transformation is performed on the coordinates in the camera coordinate system, mapping them to the clip space, as shown below:
[0100] ;
[0101] in, Represents the projection matrix. This represents the homogeneous coordinate vector in clip space. The projection matrix is determined by the camera's field of view, the distance to the near clipping plane, and the distance to the far clipping plane.
[0102] Subsequently, the clipping space coordinates are normalized, and viewport transformation is performed in conjunction with the corresponding viewport size parameters to map the 3D simulation data points to screen coordinates, thereby enabling the display of 3D simulation data in various linked views. By setting and maintaining independent camera parameters for the global view, local view, and detail view, the spatial coverage and display scale of multiple views are differentiated, providing a clear geometric basis for subsequent multi-scale linkage and synchronous updates.
[0103] Furthermore, the steps of the global-to-local linkage in the three-level linkage mechanism include:
[0104] Users select areas of interest in the global view;
[0105] Define the bounding box based on the region of interest selected by the user;
[0106] The local view adjusts camera parameters, including calculating the bounding box center, determining the viewing direction, and calculating the distance from the camera to the center, so that the view frustum surrounds the bounding box;
[0107] Display the bounding box in the global view.
[0108] Specifically, when displaying 3D simulation data in the global view, the system receives user selection operations within the global view. These selection operations indicate the spatial range of interest to the user. The selection operation is defined using two-dimensional screen coordinates, forming a closed selection area, and is associated with the viewport coordinate system corresponding to the global view.
[0109] Upon receiving a region selection operation, a back-projection calculation is performed based on the camera parameters of the global view and the position of the selected region in the screen coordinate system. This maps the selected region to a 3D space, thereby determining the corresponding 3D spatial extent. The 3D spatial extent is represented as an axis-aligned bounding box, which is determined by six boundary values, as follows:
[0110] ;
[0111] in, , , , , , These represent the minimum and maximum boundary values of the region of interest along each coordinate axis in three-dimensional space, respectively.
[0112] After determining the bounding box, its geometric center point is calculated based on the bounding box. The geometric center point is represented as:
[0113] ;
[0114] in, This indicates the coordinates of the center point of the bounding box.
[0115] The camera parameters for the partial view are adjusted based on the bounding box. The center point of the bounding box is used as the viewing target point of the partial view, and the camera's viewing direction is determined by the camera position pointing towards the center point. The distance between the camera position and the center point is calculated based on the spatial dimensions of the bounding box and the field of view parameters of the partial view to ensure that the view frustum of the partial view can completely enclose the bounding box while satisfying the near clipping plane and far clipping plane constraints. The distance from the camera to the center point can be expressed as:
[0116] ;
[0117] in, This indicates the distance from the camera position to the center point of the bounding box. This represents the maximum radius of the bounding box in three-dimensional space. This represents the field of view parameter of the camera in the partial view.
[0118] After adjusting the camera parameters in the local view, the bounding box is displayed in the global view to indicate the current spatial extent of the local view. The bounding box and the 3D simulation data in the global view are drawn using a unified spatial coordinate system, thus maintaining spatial consistency between the bounding box position and the 3D simulation data in the global view. Through these steps, a linked update from the global view to the local view is achieved, enabling the local view to accurately focus on the spatial region selected by the user in the global view.
[0119] Furthermore, the steps of the local-to-detail linkage in the three-level linkage mechanism include:
[0120] Users select a sub-region in the partial view;
[0121] Define a smaller bounding box based on the sub-region selected by the user;
[0122] The detailed view adjusts camera parameters, including calculating a smaller bounding box center, determining the viewing direction, and calculating the distance from the camera to the center, so that the view frustum surrounds a smaller bounding box;
[0123] Display the smaller bounding box in the partial view;
[0124] Display nested bounding boxes in the global view.
[0125] Specifically, when displaying 3D simulation data within a corresponding spatial range in a local view, the system receives sub-region selection operations from the user within the local view. These sub-region selection operations are defined based on the viewport coordinate system corresponding to the local view and are used to indicate to the user a smaller spatial region to focus on within the current local spatial range.
[0126] Upon receiving a sub-region selection operation, a spatial backprojection operation is performed based on the camera parameters of the local view and the sub-region's position in the screen coordinate system. This maps the sub-region into 3D space, determining the corresponding 3D spatial sub-range. The 3D spatial sub-range is represented using an axis-aligned bounding box, with smaller bounding boxes defined by six boundary values, as follows:
[0127] ;
[0128] in, , , , , , These represent the minimum and maximum boundary values of the sub-region along each coordinate axis in three-dimensional space, respectively.
[0129] After determining a smaller bounding box, its geometric center point is calculated based on the bounding box. The geometric center point is represented as:
[0130] ;
[0131] in, This represents the coordinates of the center point of the smaller bounding box.
[0132] The camera parameters for the detail view are adjusted based on a smaller bounding box. Specifically, the center point of the smaller bounding box is used as the viewing target point for the detail view, and the camera's viewing direction is determined by the camera position pointing towards the center point. The distance between the camera position and the center point is calculated based on the spatial dimensions of the smaller bounding box and the field of view parameters of the detail view, ensuring that the view frustum of the detail view completely covers the smaller bounding box while satisfying near and far clipping plane constraints. The distance from the camera to the center point is expressed as:
[0133] ;
[0134] in, This indicates the distance from the camera to the center point in the detail view. This represents the maximum radius of the smaller bounding box. This indicates the field of view parameters of the camera in the detail view.
[0135] After the camera parameters of the detail view are adjusted, a smaller bounding box is displayed in the local view to indicate the spatial range currently corresponding to the detail view. At the same time, a nested bounding box with a clear inclusion relationship is displayed in the global view, where the bounding box representing the spatial range of the local view and the smaller bounding box representing the spatial range of the detail view maintain a consistent hierarchical nesting relationship in terms of spatial position. By synchronously displaying the bounding box and its nested relationship in different views, the linkage update between the local view and the detail view is achieved, and the clarity and consistency of the corresponding relationship of the spatial range between views are maintained.
[0136] Furthermore, the steps of reverse linkage and synchronization in the three-level linkage mechanism include:
[0137] When the user performs a pan operation on the camera of the local view or the detail view, synchronously update the position of the corresponding spatial boundary range while keeping the camera parameters of the global view unchanged;
[0138] When the user performs a rotation operation on the camera of the local view or the detail view, represent the current rotation state using quaternions;
[0139] Calculate the incremental quaternion according to the rotation increment, and multiply the current quaternion by the incremental quaternion to obtain the updated quaternion;
[0140] Synchronously update the corresponding spatial boundary range according to the updated quaternion.
[0141] Specifically, receive the camera operation input of the user in the local view or the detail view. The camera operation input at least includes pan operation and rotation operation. The camera operation input takes the camera parameters corresponding to the view as the object of action and is used to change the position or attitude of the camera in the three-dimensional space.
[0142] When it is detected that the user performs a pan operation on the camera of the local view or the detail view, determine the displacement vector of the camera position according to the pan operation. The displacement vector is represented in the three-dimensional coordinate system as:
[0143] ;
[0144] where , , respectively represent the translation amounts of the camera in the three-dimensional coordinate axis directions. According to the displacement vector, perform the same translation transformation on the spatial boundary range corresponding to the view, so that the position of the spatial boundary range in the three-dimensional space is consistent with the area of interest after the camera is panned. When updating the position of the spatial boundary range, the camera parameters of the global view remain unchanged, so that the global view only reflects the current spatial position of the local view or the detail view through the position change of the boundary range.
[0145] When a user is detected rotating the camera in a partial or detailed view, the camera's rotation state is represented using quaternions. The current camera rotation state is represented as a quaternion. ;in, Representing the scalar components of a quaternion. , , Represent the vector components of a quaternion. Quaternions satisfy the normalization condition. .
[0146] Based on the user-input rotation operation, determine the camera's rotation increment parameters, including the rotation axis vector. and rotation angle Based on the rotation axis vector and rotation angle, calculate the corresponding incremental quaternion, which is expressed as:
[0147] ;
[0148] in, It is a unit vector used to represent the direction of the rotation axis.
[0149] The quaternion corresponding to the current camera rotation state With incremental quaternions Perform quaternion multiplication to obtain the updated quaternion. , represented as Among them, symbols This represents quaternion multiplication. The updated quaternion. Used to indicate the camera's attitude state after performing a rotation operation.
[0150] According to the updated quaternion A consistent rotation transformation is performed on the spatial boundary range corresponding to the camera, ensuring that the orientation of the spatial boundary range in 3D space corresponds to the viewing direction after the camera rotation. During the rotation transformation, the camera parameters of the global view remain unchanged; the rotation state of the local or detail view is reflected only by the pose change of the spatial boundary range in the global view.
[0151] Through the above-mentioned translation synchronization update and quaternion-based rotation synchronization update, reverse linkage from local view or detail view to global view is achieved, so that the spatial correspondence between different views remains consistent during camera interaction and provides stable geometric constraints for multi-scale linkage display.
[0152] Furthermore, the step of extracting data blocks of corresponding resolution from the octree structure includes:
[0153] Select low-resolution data for the global view;
[0154] Select medium-resolution data for the partial view;
[0155] Select high-resolution data for the detail view;
[0156] Based on the current camera parameters of each view, determine the required data resolution and select the corresponding data from the hierarchical spatial data structure.
[0157] Specifically, when selecting data, the corresponding camera parameter sets are obtained for the global view, local view, and detail view. These camera parameter sets include at least the camera position, field of view, near clipping plane distance, far clipping plane distance, and viewport size. Based on the camera parameters, the visible spatial range of each view in 3D space is determined, and this visible spatial range is defined by the camera's view frustum.
[0158] After determining the visible spatial range, the visible spatial range is used as the spatial query condition to perform node traversal operations in the hierarchical spatial data structure. During the traversal, for each candidate node, it is determined whether the spatial region corresponding to the node has spatial intersection with the view frustum. If there is no spatial intersection, the data corresponding to the node is not selected; if there is spatial intersection, it is further determined whether the resolution of the data corresponding to the node meets the resolution requirements of the current view.
[0159] Data resolution requirements are determined based on the view scale and camera parameters. Specifically, for any view, the projected size of the node's spatial region in screen space is calculated based on the distance between the camera position and the center point of the node's spatial region, combined with the viewport size and field of view parameters. The projected size characterizes the display requirements of the node in the current view, and its calculation method is expressed as follows:
[0160] ;
[0161] in, This represents the projected size of the node space region in screen space. It represents the characteristic length of the node spatial region in three-dimensional space. This indicates the pixel size of the viewport in the vertical direction. This represents the distance between the camera position and the center point of the node space region. This indicates the field of view of the corresponding view camera.
[0162] According to the projection size The required resolution level for each node is determined. When the projected size is smaller than a preset pixel threshold, lower-level node data is selected; when the projected size is within a preset middle range, medium-level node data is selected; and when the projected size is larger than the preset pixel threshold, higher-level node data is selected. This achieves adaptive selection of data resolution based on camera parameters and view scale.
[0163] In the global view, due to the large coverage area of its view frustum and the relatively far distance between the camera position and the overall simulation space, low-resolution data nodes closer to the root node in the hierarchical spatial data structure are selected first, provided that the spatial coverage conditions are met. In the local view, medium-level data nodes that match the spatial scale of the selected spatial region are selected. In the detail view, high-resolution data nodes closer to the leaf nodes are selected for smaller spatial regions and closer camera distances.
[0164] After node selection, the data block corresponding to the selected node is used as the data input for the current view, for subsequent data sampling and rendering processing. Through this data selection method based on camera parameters and a hierarchical spatial data structure, different views can clearly distinguish data at different spatial scales and resolutions, providing a definite data source for multi-scale interactive displays.
[0165] Furthermore, the steps of data sampling and rendering include:
[0166] Calculate the required level of detail based on the view distance and screen resolution;
[0167] Based on the calculated level of detail, select the corresponding node data from the octree structure;
[0168] Perform volume rendering or surface rendering on the selected node data;
[0169] Visualize field values, including using transfer functions to map scalar values to color and opacity.
[0170] Specifically, before data sampling and rendering, the corresponding camera parameters and viewport resolution parameters are obtained for the global view, local view, and detail view, respectively. The camera parameters include at least the camera position, field of view, near clipping plane distance, and far clipping plane distance, while the viewport resolution parameters include the number of pixels in the horizontal and vertical directions of the viewport.
[0171] Based on camera parameters and viewport resolution parameters, the required level of detail for the current view is calculated. The level of detail characterizes the spatial resolution that the 3D simulation data needs to achieve in screen space under the current view conditions. Specifically, based on the distance between the camera position and the center point of the octree node's spatial region, as well as the viewport resolution and field of view parameters, the projection error of that node's spatial region in screen space is calculated. The projection error measures the display accuracy requirements of the node data in the current view. The projection error can be expressed as:
[0172] ;
[0173] in, This represents the projection error of node data in screen space. It represents the characteristic length of the node spatial region in three-dimensional space. This represents the distance between the camera position and the center point of the node space region. This indicates the number of pixels in the viewport in the vertical direction. This indicates the field of view of the corresponding view camera.
[0174] The projection error is compared with a preset error threshold, and the required level of detail is determined based on the comparison result. When the projection error is greater than the preset error threshold, the resolution of the current node data is deemed insufficient, and higher-level child node data needs to be selected; when the projection error is not greater than the preset error threshold, the resolution of the current node data is deemed to meet the display requirements. Through the above judgment process, the set of octree nodes that meet the level of detail requirements of the current view is determined.
[0175] After determining the node set, the data blocks corresponding to the nodes are retrieved from the octree structure as the data input for the current view. Each data block includes at least the mesh data corresponding to the node's spatial region and the simulated field value data. During rendering, the appropriate rendering method is selected based on the organization of the data blocks.
[0176] When data blocks are organized as volumetric data, rendering processing is performed on the data blocks. Volumetric rendering processing includes sampling the volumetric data within the space defined by the view frustum and accumulating the sampling results along the viewing direction to generate the color and opacity values of the corresponding pixels. When data blocks are organized as surfaces or meshes, surface rendering processing is performed on the data blocks, generating the corresponding two-dimensional display results by transforming, clipping, and rasterizing the mesh vertices.
[0177] During the rendering process, a visualization mapping process is performed on the simulated field value data. Specifically, a predefined transfer function is used to map the scalar field values, converting them into color and opacity components. The transfer function is expressed as:
[0178] ;
[0179] in, Represents the scalar field values in the simulation data. This represents the corresponding color vector. This indicates the corresponding opacity value. This represents a function that maps scalar values to color and opacity.
[0180] Through the above data sampling and rendering process, data nodes that meet the display accuracy requirements can be selected according to camera parameters and screen resolution under different view conditions, and the simulation field values are presented in the corresponding viewport in the form of color and opacity, thereby realizing the visualization of three-dimensional simulation data under multi-scale conditions.
[0181] Furthermore, the step of parallel rendering in three independent viewports includes:
[0182] The rendering process is executed separately in different viewports via a graphical interface;
[0183] The rendering results of the corresponding view are displayed in real time in the viewport to achieve multi-scale interactive display.
[0184] Specifically, during the display phase, independent viewport regions are allocated to the global view, local view, and detail view. These viewport regions may be located within the same display window or in different display windows. Each viewport is associated with a corresponding view and is bound to an independent rendering context or an equivalent set of rendering states to ensure that the rendering parameters of each view do not interfere with each other.
[0185] During the rendering process, for each view, the rendering pipeline state is configured based on the camera parameters, selected data blocks, and viewport size information. The rendering pipeline state includes at least viewport extent settings, depth test parameters, clipping parameters, and projection and view transformation parameters matching the current view. The rendering pipeline state is bound to the corresponding viewport via a graphical interface, ensuring that subsequent drawing operations only affect the current viewport area.
[0186] During the rendering process of each view, for the data blocks selected from the hierarchical spatial data structure, steps such as vertex processing, coordinate transformation, clipping, rasterization, and fragment processing are performed sequentially to generate the corresponding 2D image result in the view. The coordinate transformation process uses the model-view transformation matrix and projection transformation matrix corresponding to that view, thereby ensuring that the same 3D simulation data is displayed in different views according to their respective spatial scales and camera parameters.
[0187] After rendering a single view, the rendering result is written to its corresponding viewport buffer. The rendering process is repeated for the global view, local view, and detail view, respectively, so that the rendering results of each view are generated and stored in their respective viewport buffers. The rendering process is executed in a predetermined refresh order or in parallel within the same refresh cycle, thereby ensuring synchronous updates of the content displayed in each view.
[0188] During the display phase, the rendering results in each viewport buffer are output to the display device, so that the global view, local view, and detail view are simultaneously presented in their respective viewports. When the camera parameters, selected data blocks, or linkage state of any view change, the rendering process of the corresponding view is retried, and the display content in its view is updated synchronously, while the views that have not changed retain their original display results.
[0189] By using the above method, the rendering process of each view is executed and managed separately in different viewports, so as to realize the independent display and synchronous refresh of multiple views in the same display environment, thereby ensuring that the multi-scale linkage relationship between global view, local view and detail view can be accurately presented at the visual level.
[0190] Example 2:
[0191] A system for three-level linkage processing and display of 3D simulation data is provided, which is used to implement the aforementioned method for three-level linkage processing and display of 3D simulation data. The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0192] The memory is used to store 3D simulation data, hierarchical spatial data structures, and computer programs. 3D simulation data includes spatial coordinate data and the corresponding simulation field values. The hierarchical spatial data structure is used to organize the 3D simulation data according to spatial scales to support the selection and access of data at different resolutions. The memory is a computer-readable storage medium that provides data and program read / write support to the processor.
[0193] The processor is electrically connected to the memory and is used to execute computer programs stored in the memory. When executing the computer program, the processor calls and processes 3D simulation data and hierarchical spatial data structures, and performs operations such as data preprocessing, view and camera parameter setting, linkage control, data selection, and rendering display according to program instructions.
[0194] The computer program includes a set of instructions for implementing three-level linkage processing and display of 3D simulation data. When the processor executes the computer program, it performs the following functions in sequence:
[0195] The input 3D simulation data is preprocessed and a hierarchical spatial data structure is constructed.
[0196] Define a global view, a local view, and a detail view, and set camera parameters for each view separately;
[0197] A three-level linkage mechanism is triggered in response to user interaction events to achieve synchronous updates between the global view, local view, and detail view;
[0198] Based on the camera parameters of each view, select data that matches the view scale from the hierarchical spatial data structure;
[0199] The selected data is sampled and rendered, and the rendering results of each view are displayed in the corresponding viewport.
[0200] In the system, during the execution of the computer program, the processor calls and controls the various functional steps according to a predetermined processing flow to ensure the consistency of the spatial position and scale relationship of the displayed results of the 3D simulation data under different views. Through the above system structure and its operation mode, the system realizes a method for three-level linkage processing and display of 3D simulation data under the condition of hardware and software collaboration.
[0201] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for three-level linkage processing and display of three-dimensional simulation data, characterized in that, Includes the following steps: The input 3D simulation data is preprocessed and a hierarchical structure is constructed to obtain an octree structure; Define the global view, local view, and detail view, and set the camera parameters for each view; A three-level linkage mechanism is triggered by user interaction events to achieve synchronous updates of the global view, local view, and detail view. The three-level linkage mechanism includes: global-to-local linkage, local-to-detail linkage, and reverse linkage and synchronization. Based on the current camera parameters of each view, data blocks of the corresponding resolution are extracted from the octree structure, and data sampling and rendering are performed in parallel in three independent viewports.
2. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The steps for preprocessing and hierarchical structure construction of the input 3D simulation data include: The spatial domain corresponding to the 3D simulation data is divided into a multi-level mesh structure; An octree structure is used to manage the multi-level grid structure; When constructing the octree structure, the space is recursively subdivided starting from the root node, so that octree nodes at different levels correspond to data blocks of different spatial scales. The grid data and field value data at the corresponding scale are stored in the corresponding octree nodes.
3. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The steps of defining a global view, a local view, and a detail view, and setting camera parameters for each view, include: Set the camera in the global view to cover the entire simulation space. The camera position of the partial view and detail view is dynamically adjusted based on the user's selection. Set the viewing direction and view frustum parameters for each view; The 3D simulation data is projected and transformed to convert the 3D coordinates into screen coordinates for display.
4. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The steps of the global-to-local linkage in the three-level linkage mechanism include: Users select areas of interest in the global view; Define the bounding box based on the region of interest selected by the user; The camera parameters are adjusted in the local view, including calculating the center of the bounding box, determining the viewing direction, and calculating the distance from the camera to the center, so that the view frustum surrounds the bounding box; Display the bounding box in the global view.
5. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The steps of the local-to-detail linkage in the three-level linkage mechanism include: Users select a sub-region in the partial view; Define a smaller bounding box based on the sub-region selected by the user; The detailed view adjusts camera parameters, including calculating the smaller bounding box center, determining the viewing direction, and calculating the distance from the camera to the center, so that the view frustum surrounds the smaller bounding box; Display the smaller bounding box in the partial view; Display nested bounding boxes in the global view.
6. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The reverse linkage and synchronization steps in the three-level linkage mechanism include: When a user pans the camera in a local view or detail view, the position of the corresponding spatial boundary range is updated synchronously, while the camera parameters of the global view remain unchanged. When a user rotates the camera in a partial view or detail view, a quaternion is used to represent the current rotation state. The incremental quaternion is calculated based on the rotation increment, and the current quaternion is multiplied by the incremental quaternion to obtain the updated quaternion; The corresponding spatial boundary range is updated synchronously based on the updated quaternion.
7. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The step of extracting data blocks of corresponding resolution from the octree structure includes: Select low-resolution data for the global view; Select medium-resolution data for the partial view; Select high-resolution data for the detail view; Based on the current camera parameters of each view, the required data resolution is determined, and the corresponding data is selected from the hierarchical spatial data structure.
8. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The steps for data sampling and rendering include: Calculate the required level of detail based on the view distance and screen resolution; Based on the calculated level of detail, select the corresponding node data from the octree structure; Perform volume rendering or surface rendering on the selected node data; Visualize field values, including using transfer functions to map scalar values to color and opacity.
9. The method for three-level linkage processing and display of three-dimensional simulation data according to claim 1, characterized in that, The steps of parallel rendering in three independent viewports include: The rendering process is executed separately in different viewports via a graphical interface; The rendering results of the corresponding view are displayed in real time in the viewport to achieve multi-scale linkage display.
10. A system for three-dimensional simulation data three-level linkage processing and display, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a method for three-dimensional simulation data three-level linkage processing and display as described in any one of claims 1 to 9.