CN107481311B - Three-dimensional city model rendering method and device - Google Patents

Three-dimensional city model rendering method and device Download PDF

Info

Publication number
CN107481311B
CN107481311B CN201710733641.1A CN201710733641A CN107481311B CN 107481311 B CN107481311 B CN 107481311B CN 201710733641 A CN201710733641 A CN 201710733641A CN 107481311 B CN107481311 B CN 107481311B
Authority
CN
China
Prior art keywords
model
loading
rendering
preset range
dimensional city
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710733641.1A
Other languages
Chinese (zh)
Other versions
CN107481311A (en
Inventor
姚春雨
彭桂辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China coal (Xi'an) aerial survey and Remote Sensing Research Institute Co.,Ltd.
Aerial Photogrammetry and Remote Sensing Co Ltd
Original Assignee
China Coal Xi'an Aerial Survey And Remote Sensing Research Institute Co ltd
Aerial Photogrammetry and Remote Sensing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Coal Xi'an Aerial Survey And Remote Sensing Research Institute Co ltd, Aerial Photogrammetry and Remote Sensing Co Ltd filed Critical China Coal Xi'an Aerial Survey And Remote Sensing Research Institute Co ltd
Priority to CN201710733641.1A priority Critical patent/CN107481311B/en
Publication of CN107481311A publication Critical patent/CN107481311A/en
Application granted granted Critical
Publication of CN107481311B publication Critical patent/CN107481311B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a three-dimensional city model rendering method and device. The method comprises the following steps: and setting a preset range model, and constructing a quadtree index based on the preset range model according to the bounding box and the rendering grade of each three-dimensional city model included in the preset range model. And obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree, and setting a corresponding visible distance for each model loading type of each model according to the rendering level of each model. And traversing each node of the scene tree, and selecting a model loading type meeting loading conditions according to the current viewpoint distance to load and render the model corresponding to the current node. Therefore, by utilizing the advantage of high query efficiency of the quadtree and considering the complexity of the model, the important three-dimensional city model can be loaded preferentially, the secondary model is loaded later, the loading sequence of the model is more in line with the habit of human vision, the rendering efficiency of the model is high, and the rendering smoothness is good.

Description

Three-dimensional city model rendering method and device
Technical Field
The invention relates to the technical field of three-dimensional models, in particular to a three-dimensional city model rendering method and device.
Background
With the rapid development of the traditional mapping industry technology, the application field of the three-dimensional digital city model is wider and wider, and the roaming browsing of a single cell or a small scene is developed to the three-dimensional application of the whole city. With the continuous improvement of the technology, the model precision and the model simulation degree are greatly improved, however, the improvement of the precision and the simulation degree also brings a problem: the amount of data has increased dramatically. The number of urban building models in a three-dimensional digital urban scene is huge, the structure is complex, and it is unrealistic to load all urban models into a computer memory in real-time scene drawing, so that model data meeting conditions need to be quickly inquired from all urban three-dimensional model data and loaded into the computer memory. To complete the quick query of the urban three-dimensional model, establishing the spatial index of the data is an indispensable one-step process.
For the spatial index of data, commonly used spatial partition organization index structures include a grid index, a B tree, an R tree, a quadtree, an octree, and the like. The data storage structure of the quad tree is a hierarchical tree structure, and the quad tree is high in query efficiency and is widely applied to the aspect of three-dimensional digital cities at present.
However, the existing quadtree construction method is only based on the visual distance for rendering and loading, the complexity of the urban model is not considered, the loading mode is not flexible enough, some important urban models cannot be loaded preferentially, and the time for waiting for loading is long. Moreover, some models cannot be loaded and rendered even due to poor visible distance.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a three-dimensional city model rendering method and a three-dimensional city model rendering device, which can enable an important three-dimensional city model to be loaded preferentially and a secondary model to be loaded later, and enable the loading sequence of the models to be more in line with the human visual habit.
The invention aims at providing a three-dimensional city model rendering method, which is applied to a computing device stored with a three-dimensional city model file and comprises the following steps:
setting a preset range model, and constructing a quad-tree index based on the preset range model according to a bounding box and a rendering grade of each three-dimensional city model included in the preset range model, wherein the preset range model comprises a plurality of three-dimensional city models, and the rendering grade of each three-dimensional city model can be obtained according to model weight;
obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree, and setting a corresponding visible distance for each model loading type of each model according to the rendering level of each model, wherein each model is configured with three model loading types, including: fine die, middle die and rough die;
traversing each node of the scene tree, and selecting a model loading type meeting loading conditions according to the current viewpoint distance to load and render a model corresponding to the current node, wherein each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is the distance between the current viewpoint and the model corresponding to the current node.
A second object of the present invention is to provide an apparatus for rendering a three-dimensional city model, the apparatus being applied to a computing device storing a three-dimensional city model file, the apparatus comprising:
the index building module is used for setting a preset range model and building a quad-tree index based on the preset range model according to a bounding box and a rendering grade of each three-dimensional city model, wherein the preset range model comprises a plurality of three-dimensional city models, and the rendering grade of each three-dimensional city model can be obtained according to model weight;
a model processing module, configured to obtain a model subset according to the current viewpoint position and the quadtree index, process the model subset and update the model subset into a scene tree, and set a corresponding visible distance for each model loading category of each model according to a rendering level of each model, where each model is configured with three model loading categories, including: fine die, middle die and rough die;
and the loading rendering module is used for traversing each node of the scene tree, selecting a model loading type meeting loading conditions according to the current viewpoint distance, and loading and rendering the model corresponding to the current node, wherein each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is the distance between the current viewpoint and the model corresponding to the current node.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a three-dimensional city model rendering method and a device, wherein the method is applied to computing equipment stored with a three-dimensional city model file, and comprises the following steps: setting a preset range model, and constructing a quad-tree index based on the preset range model according to a bounding box and a rendering grade of each three-dimensional city model included in the preset range model, wherein the preset range model comprises a plurality of three-dimensional city models, and the rendering grade of each three-dimensional city model can be obtained according to model weight. Obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree, and setting a corresponding visible distance for each model loading type of each model according to the rendering level of each model, wherein each model is configured with three model loading types, including: fine die, middle die and coarse die. Traversing each node of the scene tree, and selecting a model loading type meeting loading conditions according to the current viewpoint distance to load and render a model corresponding to the current node, wherein each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is the distance between the current viewpoint and the model corresponding to the current node. Therefore, by utilizing the advantage of high query efficiency of the quadtree and considering the complexity of the urban model, the important three-dimensional urban model can be loaded preferentially, the secondary model is loaded later, the loading sequence of the model is more in line with the habit of human vision, the rendering efficiency of the model is high, and the rendering smoothness is good.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a block diagram of a computing device according to a preferred embodiment of the present invention.
Fig. 2 is a flowchart illustrating steps of a three-dimensional city model rendering method according to a first embodiment of the present invention.
Fig. 3 is a flowchart illustrating sub-steps of step S110 shown in fig. 2 according to a first embodiment of the present invention.
Fig. 4 is a flowchart of sub-steps of the sub-step S111 shown in fig. 3 according to the first embodiment of the present invention.
Fig. 5 is a flowchart of sub-steps of the sub-step S113 shown in fig. 3 according to the first embodiment of the present invention.
Fig. 6 is a flowchart illustrating sub-steps of step S130 shown in fig. 2 according to a first embodiment of the present invention.
Fig. 7 is a functional block diagram of a three-dimensional city model rendering apparatus according to a second embodiment of the present invention.
Icon: 100-a computing device; 110-a memory; 120-a processor; 130-a network module; 140-a display card module; 200-a three-dimensional city model rendering device; 210-an index building module; 220-a model processing module; 230-load rendering module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Furthermore, the terms "first," "second," and the like are used merely to distinguish one description from another, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a block diagram of a computing device 100 according to a preferred embodiment of the invention. The computing device 100 includes a memory 110, a three-dimensional city model rendering apparatus 200, a processor 120, and a network module 130.
The memory 110, the processor 120 and the network module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The memory 110 stores therein a three-dimensional city model rendering apparatus 200, the three-dimensional city model rendering apparatus 200 includes at least one software functional module which can be stored in the memory 110 in the form of software or firmware (firmware), and the processor 120 executes various functional applications and data processing by running the software programs and modules stored in the memory 110.
The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 110 is used for storing a program, and the processor 120 executes the program after receiving an execution instruction. Further, the software programs and modules within the memory 110 may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The processor 120 may be an integrated circuit chip having signal processing capabilities. The Processor 120 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The network module 130 is used for implementing communication connection and data transmission between the computing device 100 and other external devices through a network.
The graphics card module 140 is configured to perform operation processing on the graphics data to relieve operation pressure of the processor 120. The core component of the Graphics card module 140 is a GPU (Graphics Processing Unit), and is configured to convert and drive Graphics data information required by the computing device 100, and control a display to display the Graphics data information.
It will be appreciated that the configuration depicted in FIG. 1 is merely illustrative, and that computing device 100 may include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
First embodiment
Referring to fig. 2, fig. 2 is a flowchart illustrating a three-dimensional city model rendering method according to a first embodiment of the present invention. The method is applied to a computing device 100 storing a three-dimensional city model file. The following describes the specific flow of the three-dimensional city model rendering method in detail.
Step S110, setting a preset range model, and constructing a quadtree index based on the preset range model according to the bounding boxes and rendering levels of each three-dimensional city model included in the preset range model.
In this embodiment, the preset range model includes a plurality of three-dimensional city models, and the rendering level of each three-dimensional city model can be obtained according to the model weight.
Referring to fig. 3, fig. 3 is a flowchart illustrating sub-steps of step S110 shown in fig. 2 according to a first embodiment of the present invention. The step S110 includes a substep S111, a substep S112, and a substep S113.
And a substep S111, setting a preset range model, calculating a bounding box corresponding to the preset range model, and taking the bounding box corresponding to the preset range model as a root node of the quadtree.
Referring to fig. 4, fig. 4 is a flowchart illustrating sub-steps S111 shown in fig. 3 according to a first embodiment of the present invention. The sub-step S111 includes a sub-step S1111, a sub-step S1112, a sub-step S1113, and a sub-step S1114.
And a sub-step S1111 of detecting whether the user designates the preset range model.
If so, perform substep S1112.
And a substep S1112, taking the three-dimensional city model designated by the user as a preset range model, and calculating a bounding box corresponding to the preset range model.
If not, perform substep S1113.
And a substep S1113, taking all three-dimensional city models included in the computing device 100 as a preset range model and calculating bounding boxes corresponding to the preset range model.
In this embodiment, the user may formulate the model content included in the preset range model according to the requirement. If not specified by the user, the computing device 100 may default to the predetermined range model. For example, the computing device 100 stores a plurality of three-dimensional city model files constituting a city model in advance, and if not specified by the user, the computing device 100 may default to all three-dimensional city models included in the constituting city model as the preset range model. If the city model specified by the user to be constructed includes a model of the metropolis + Chongqing city, the computing device 100 may obtain all three-dimensional city model files included in the construction of the Chongqing city model, and then use all three-dimensional city models included in the construction of the metropolis + Chongqing city model as the preset range model. Then, a bounding box corresponding to the preset range model is calculated.
In this embodiment, bounding box is an algorithm for solving the optimal bounding space of discrete point set, and the basic idea is to approximately replace complex geometric objects with geometric objects (called bounding boxes) with slightly larger volumes and simple characteristics. The surrounding box is used for replacing a complex three-dimensional city model approximately, so that calculation and analysis can be facilitated.
And a substep S1114, taking the bounding box corresponding to the preset range model as a root node of the quadtree.
In this embodiment, by setting the preset range model, the model range can be specified, which facilitates subsequent model indexing.
And a substep S112, calculating a bounding box of each three-dimensional city model, and obtaining a corresponding rendering grade according to the model weight of each three-dimensional city model.
In this embodiment, the computing device 100 first calculates a bounding box for each three-dimensional city model included in the preset range model. The computing device 100 calculates a model weight corresponding to each three-dimensional city model according to a preset weight rule according to the weight ratio corresponding to different model parameters, and determines a rendering level of the three-dimensional city model according to the corresponding relationship between the model weight and the rendering level. Wherein the different model parameters may include: the geographic location of the model, the bounding box, the number of vertices, the number of textures, and the size of the volume. The rendering level may include, but is not limited to: low, medium, high and top levels.
In this embodiment, the weight ratio and the preset weight rule corresponding to each model parameter, and the model weight and the rendering level can be set according to actual requirements. Thus, the computing device 100 may set the rendering level of the three-dimensional city model corresponding to some important city buildings with important geographic positions, high number of vertices, complex textures and large volumes as top level or high level, so that the important building models can be preferentially indexed to be preferentially loaded for rendering.
And a substep S113, traversing all three-dimensional city models included in the preset range model, and constructing a quadtree index based on the preset range model according to the bounding box and the rendering level of each three-dimensional city model.
Referring to fig. 5, fig. 5 is a flowchart illustrating sub-steps of the sub-step S113 shown in fig. 3 according to the first embodiment of the present invention. The sub-step S113 includes a sub-step S1131, a sub-step S1132, a sub-step S1133, a sub-step S1134, a sub-step S1135, and a sub-step S1136.
And a substep S1131 of detecting whether the rendering level of the next model traversed based on the current node is the top level according to the traversal order.
In this embodiment, the traversal order may be set according to actual requirements, for example, sequentially traversing according to the file numbers of the model files. Wherein, during the initial traversal, the root node is taken as the initial current node.
If it is at the top level, sub-step S1132 is performed to add the model to the root node.
If not, performing the sub-step S1133 to detect whether the topological relationship between the bounding box of the model and the bounding box of the child node of the current node is intersected.
In this embodiment, the topological relation may include: intersect and contain. The topological relation is that the range included by the bounding box of the intersected representation model is intersected with the range included by the bounding box of the child node of the current node. The topological relation is that the range included by the bounding box representing the model is within the range included by the bounding box of the child node of the current node.
If the topological relation is intersected, the substep S1134 is executed to execute the node setting operation corresponding to the intersected topological relation.
In this embodiment, the step of executing the node setting operation corresponding to the intersection of the topological relation includes:
it is detected whether the rendering level of the model is high. If not, the model is added to the current node. If the node is advanced, whether a parent node exists in the current node is detected. And if the parent node exists, adding the model into the parent node of the current node. And if the parent node does not exist, adding the model into the current node.
In this embodiment, if the topological relations are not intersected, the topological relations are contained.
If the topological relation is contained, the substep S1135 is executed to execute the node setting operation corresponding to the topological relation being contained.
In this embodiment, the step of executing the node setting operation corresponding to the included topological relation includes:
and detecting whether the bounding box of the child node of the current node is smaller than a preset specified value or not, or whether the number of layers of the quadtree where the child node of the current node is located is larger than the preset number of layers or not. And if the current node is smaller than the preset specified value or larger than the preset layer number, adding the model into the current node. And if the number of the sub-nodes is not less than the preset specified value or not more than the preset number of layers, setting the sub-nodes of the current node as the current node, and detecting the topological relation between the bounding box of the model and the bounding box of the sub-nodes of the current node after resetting.
In this embodiment, the preset specified value or the preset number of layers may be set according to actual requirements. The preset specified value or the preset layer number is set to facilitate jumping out of the circulation of the steps, so that the situation of infinite circulation is avoided.
After the node setting operation corresponding to the model is completed, the substep S1136 is executed to detect whether the model is the last model.
And if the model is detected as the last model, judging that the construction of the quadtree index based on the preset range model is completed.
If the detection is not the last model, the procedure returns to substep S1131.
And step S120, obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree, and setting a corresponding visible distance for each model loading type of each model according to the rendering level of each model.
In this embodiment, the computing device 100 detects distances between all nodes at the bottom layer of the quadtree index and the current viewpoint, and selects a plurality of target nodes and models corresponding to all upper nodes of each target node as a model subset (for example, M), where the target nodes are the bottom layer nodes whose distances from the current viewpoint are smaller than a preset distance.
In this embodiment, the computing device 100 adds each model in the subset of models M as a paged level of detail node to the scene tree.
In this embodiment, the computing device 100 may set a corresponding visible distance for each model load category of each model according to the rendering level of each model. Wherein, each model is configured with three model loading categories, including: fine die, middle die and coarse die. This is illustrated by way of example below.
For example, if the rendering level of a certain model is middle, the visible distances of the fine mode, the middle mode and the coarse mode of the model can be set as follows: l, L1, L2. If the rendering level of a certain model is low, the visible distances of the fine mode, the middle mode and the coarse mode of the model can be set to be L/2, L1/2 and L2/2 respectively. If the rendering level of a certain model is high, the visible distances of the fine mode, the middle mode and the coarse mode of the model can be set to be 2 × L, 2 × L1 and 2 × L2 respectively. If the rendering level of a model is the top level, the visible distances of the fine mode, the middle mode and the coarse mode of the model are set to be 4 xL, 4 xL 1 and 4 xL 2 respectively.
In this embodiment, by reasonably setting the visible distance of the model, the situation that the model cannot be loaded and rendered can be avoided.
Step S130, traversing each node of the scene tree, selecting a model loading type meeting loading conditions according to the current viewpoint distance, and loading and rendering the model corresponding to the current node.
In this embodiment, each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is a distance between the current viewpoint and the model corresponding to the current node.
Referring to fig. 6, fig. 6 is a flowchart illustrating sub-steps of step S130 shown in fig. 2 according to a first embodiment of the present invention. The step S130 includes a sub-step S131 and a sub-step S132.
And a substep S131, detecting the distance of the current viewpoint, comparing the distance of the current viewpoint with the visible distances of the three model loading types of the model corresponding to the current node respectively, and selecting the model loading type meeting the corresponding loading condition to load and render the model corresponding to the current node.
The following describes the sub-step S131 in detail.
The computing device 100 compares the current viewpoint distance with the visible distance of the precision model of the model corresponding to the current node, and detects whether the precision model loading condition is satisfied.
If the condition for loading the precision model is satisfied, the computing device 100 obtains a precision model data file to be loaded, and detects whether the vertex data of the model is loaded. And if so, loading the texture data included in the fine mode data file. And if not, loading the vertex data and the texture data included in the fine mode data file, and marking the vertex data as loaded after the loading is finished.
If the fine mode loading condition is not satisfied, the computing device 100 compares the current viewpoint distance with the visible distance of the middle mode of the model corresponding to the current node, and detects whether the middle mode loading condition is satisfied.
If the middle mold loading condition is satisfied, the computing device 100 obtains a middle mold data file to be loaded, and detects whether the vertex data of the model is loaded. And if so, loading texture data included in the middle module data file. And if not, loading the vertex data and the texture data included in the middle-modulus data file, and marking the vertex data as loaded after the loading is finished.
If the medium mode loading condition is not satisfied, the computing device 100 acquires a coarse mode data file to be loaded, and loads coarse mode data.
Specifically, the above steps are explained by way of examples. Assuming that the rendering level of a certain model is middle level, the visible distances of the fine mode, the middle mode and the coarse mode of the model are respectively: l is 0-1500 m, L1 is 1500-3000 m, and L2 is more than 3000 m. If the distance between the current viewpoint and the current viewpoint is 1000 meters and is between 0 and 1500 meters, it indicates that the precision mold loading condition is satisfied, and the computing device 100 may obtain the precision mold data file for loading and rendering. Likewise, the same is true for loading the middle mold or the coarse mold.
And a substep S132 of detecting whether the model corresponding to the current node is the last model or not, and judging that the loading rendering is finished when the model corresponding to the current node is the last model.
In the embodiment, the important three-dimensional city model can be loaded preferentially, and rendering fluency is improved. In addition, the invention sets model weight for each three-dimensional city model, and can set model loading sequence according to the model weight, so that the important model is loaded first, and the secondary model is loaded later. The order in which the rendering is loaded by the computing device 100 is made closer to the viewing order of the human eye viewpoints.
Second embodiment
Referring to fig. 7, fig. 7 is a functional block diagram of a three-dimensional city model rendering apparatus 200 according to a second embodiment of the present invention. The apparatus is applied to a computing device 100 storing a three-dimensional city model file. The three-dimensional city model rendering apparatus 200 includes: an index building module 210, a model processing module 220, and a load rendering module 230.
The index building module 210 is configured to set a preset range model, and build a quadtree index based on the preset range model according to a bounding box and a rendering level of each three-dimensional city model included in the preset range model, where the preset range model includes a plurality of three-dimensional city models, and the rendering level of each three-dimensional city model is obtained according to a model weight.
In the present embodiment, the index building module 210 is configured to execute step S110 in fig. 2, and the detailed description about the index building module 210 may refer to the description of step S110 in fig. 2.
A model processing module 220, configured to obtain a model subset according to the current viewpoint position and the quadtree index, process the model subset and update the model subset into a scene tree, and set a corresponding visible distance for each model loading category of each model according to the rendering level of each model, where each model is configured with three model loading categories, including: fine die, middle die and coarse die.
In the present embodiment, the model processing module 220 is configured to execute step S120 in fig. 2, and the detailed description about the model processing module 220 may refer to the description of step S120 in fig. 2.
And a loading rendering module 230, configured to traverse each node of the scene tree, and select a model loading type meeting a loading condition according to a current viewpoint distance, where each node of the scene tree corresponds to one three-dimensional city model, and the current viewpoint distance is a distance between the current viewpoint and the model corresponding to the current node, to load and render the model corresponding to the current node.
In this embodiment, the load rendering module 230 is configured to execute step S130 in fig. 2, and the detailed description about the load rendering module 230 may refer to the description of step S130 in fig. 2.
In summary, the present invention provides a three-dimensional city model rendering method and apparatus, where the method is applied to a computing device storing a three-dimensional city model file, and the method includes: setting a preset range model, and constructing a quad-tree index based on the preset range model according to a bounding box and a rendering grade of each three-dimensional city model included in the preset range model, wherein the preset range model comprises a plurality of three-dimensional city models, and the rendering grade of each three-dimensional city model can be obtained according to model weight. Obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree, and setting a corresponding visible distance for each model loading type of each model according to the rendering level of each model, wherein each model is configured with three model loading types, including: fine die, middle die and coarse die. Traversing each node of the scene tree, and selecting a model loading type meeting loading conditions according to the current viewpoint distance to load and render a model corresponding to the current node, wherein each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is the distance between the current viewpoint and the model corresponding to the current node.
Therefore, by utilizing the advantage of high query efficiency of the quadtree and considering the complexity of the urban model, the important three-dimensional urban model can be loaded preferentially, the secondary model is loaded later, the loading sequence of the model is more in line with the habit of human vision, the rendering efficiency of the model is high, and the rendering smoothness is good.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A three-dimensional city model rendering method is applied to a computing device with a three-dimensional city model file stored therein, and comprises the following steps:
setting a preset range model, and constructing a quad-tree index based on the preset range model according to a bounding box and a rendering grade of each three-dimensional city model included in the preset range model, wherein the preset range model comprises a plurality of three-dimensional city models, and the rendering grade of each three-dimensional city model can be obtained according to model weight;
obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree, and setting a corresponding visible distance for each model loading type of each model according to the rendering level of each model, wherein each model is configured with three model loading types, including: fine die, middle die and rough die;
traversing each node of the scene tree, and selecting a model loading type meeting loading conditions according to a current viewpoint distance to load and render a model corresponding to the current node, wherein each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is the distance between the current viewpoint and the model corresponding to the current node;
the step of obtaining a model subset according to the current viewpoint position and the quadtree index, processing the model subset and updating the model subset into a scene tree comprises the following steps:
detecting the distances between all nodes at the bottommost layer of the quad-tree index and the current viewpoint, and selecting a plurality of target nodes and models corresponding to all upper-layer nodes of all the target nodes as model subsets, wherein the target nodes are the bottommost layer nodes with the distances to the current viewpoint smaller than a preset distance;
each model in the subset of models is added to the scene tree as a paged level of detail node.
2. The method according to claim 1, wherein the step of setting a preset range model, and constructing a quadtree index based on the preset range model according to the bounding box and the rendering level of each three-dimensional city model included in the preset range model comprises:
setting a preset range model, calculating a bounding box corresponding to the preset range model, and taking the bounding box corresponding to the preset range model as a root node of a quadtree;
calculating a bounding box of each three-dimensional city model, and obtaining a corresponding rendering grade according to the model weight of each three-dimensional city model, wherein the rendering grade comprises a low grade, a middle grade, a high grade and a top grade;
traversing all three-dimensional city models included by the preset range model, and constructing a quadtree index based on the preset range model according to the bounding box and the rendering level of each three-dimensional city model.
3. The method according to claim 2, wherein the step of setting a preset range model and calculating a bounding box corresponding to the preset range model comprises:
detecting whether a user designates a preset range model or not;
if the three-dimensional city model is appointed, taking the three-dimensional city model appointed by the user as a preset range model, and calculating a bounding box corresponding to the preset range model;
if not, taking all three-dimensional city models included in the computing equipment as a preset range model and computing bounding boxes corresponding to the preset range model.
4. The method of claim 2, wherein the step of computing a bounding box for each three-dimensional city model, and deriving the corresponding rendering level according to the model weight for each three-dimensional city model comprises:
calculating a bounding box of each three-dimensional city model included in the preset range model;
calculating the model weight corresponding to each three-dimensional city model according to the weight ratio corresponding to different model parameters and a preset weight rule, and determining the rendering level of the three-dimensional city model according to the corresponding relation between the model weight and the rendering level, wherein the different model parameters comprise the geographic position, the bounding box, the vertex number, the texture number and the volume size of the model.
5. The method of claim 2, wherein traversing all three-dimensional city models included in the preset range model, and the step of constructing the quadtree index based on the preset range model according to the bounding box and the rendering level of each three-dimensional city model comprises:
detecting whether the rendering level of a next model traversed based on the current node is a top level or not according to a traversal sequence, wherein during an initial traversal, a root node is used as an initial current node;
if the model is the top level, adding the model into the root node;
if not, detecting the topological relation between the bounding box of the model and the bounding box of the child node of the current node;
if the topological relation is intersected, executing the node setting operation corresponding to the intersected topological relation;
if the topological relation is contained, executing the node setting operation corresponding to the topological relation when the topological relation is contained;
and detecting whether the model is the last model or not, and judging that the construction of the quadtree index based on the preset range model is finished when the model is detected to be the last model.
6. The method according to claim 1, wherein the step of selecting a model loading category satisfying a loading condition according to the current viewpoint distance to load and render the model corresponding to the current node comprises:
detecting the distance of a current viewpoint, comparing the distance of the current viewpoint with the visible distances of three model loading types of the model corresponding to the current node respectively, and selecting the model loading type meeting the corresponding loading condition to load and render the model corresponding to the current node;
and detecting whether the model corresponding to the current node is the last model or not, and judging that the loading rendering is finished when the model corresponding to the current node is the last model.
7. The method of claim 6, wherein the step of comparing the current viewpoint distance with the visible distances of three model loading types of the model corresponding to the current node respectively, and selecting the model loading type meeting the corresponding loading condition to perform loading rendering on the model corresponding to the current node comprises:
comparing the current viewpoint distance with the visible distance of the precision mold of the model corresponding to the current node, and detecting whether the precision mold loading condition is met;
if the precision mould loading condition is met, acquiring a precision mould data file to be loaded, and detecting whether the vertex data of the model is loaded;
if the texture data is loaded, loading the texture data included in the fine mode data file;
if not, loading the vertex data and the texture data included in the fine mode data file, and marking the vertex data as loaded after the loading is finished;
if the precision mould loading condition is not met, comparing the current viewpoint distance with the visible distance of the middle mould of the model corresponding to the current node, and detecting whether the middle mould loading condition is met;
if the middle mould loading condition is met, acquiring a middle mould data file to be loaded, and detecting whether the vertex data of the model is loaded;
if the texture data is loaded, loading the texture data included in the middle-modulus data file;
if not, loading the vertex data and the texture data included in the middle-modulus data file, and marking the vertex data as loaded after the loading is finished;
and if the medium mode loading condition is not met, acquiring a coarse mode data file to be loaded, and loading coarse mode data.
8. An apparatus for rendering a three-dimensional city model, the apparatus being applied to a computing device storing a three-dimensional city model file, the apparatus comprising:
the index building module is used for setting a preset range model and building a quad-tree index based on the preset range model according to a bounding box and a rendering grade of each three-dimensional city model, wherein the preset range model comprises a plurality of three-dimensional city models, and the rendering grade of each three-dimensional city model can be obtained according to model weight;
a model processing module, configured to obtain a model subset according to the current viewpoint position and the quadtree index, process the model subset and update the model subset into a scene tree, and set a corresponding visible distance for each model loading category of each model according to a rendering level of each model, where each model is configured with three model loading categories, including: fine die, middle die and rough die;
the loading rendering module is used for traversing each node of the scene tree, selecting a model loading type meeting loading conditions according to a current viewpoint distance, and loading and rendering a model corresponding to the current node, wherein each node of the scene tree corresponds to a three-dimensional city model, and the current viewpoint distance is the distance between the current viewpoint and the model corresponding to the current node;
the model processing module is further configured to detect distances between all nodes at the bottommost layer of the quadtree index and the current viewpoint, and select a plurality of target nodes and models corresponding to all upper-layer nodes of the target nodes as a model subset, where the target nodes are the bottommost layer nodes whose distances from the current viewpoint are smaller than a preset distance; each model in the subset of models is added to the scene tree as a paged level of detail node.
9. The apparatus of claim 8, wherein the manner for the loading rendering module to select the model loading category satisfying the loading condition according to the current viewpoint distance to load and render the model corresponding to the current node comprises:
detecting the distance of a current viewpoint, comparing the distance of the current viewpoint with the visible distances of three model loading types of the model corresponding to the current node respectively, and selecting the model loading type meeting the corresponding loading condition to load and render the model corresponding to the current node;
and detecting whether the model corresponding to the current node is the last model or not, and judging that the loading rendering is finished when the model corresponding to the current node is the last model.
CN201710733641.1A 2017-08-24 2017-08-24 Three-dimensional city model rendering method and device Active CN107481311B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710733641.1A CN107481311B (en) 2017-08-24 2017-08-24 Three-dimensional city model rendering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710733641.1A CN107481311B (en) 2017-08-24 2017-08-24 Three-dimensional city model rendering method and device

Publications (2)

Publication Number Publication Date
CN107481311A CN107481311A (en) 2017-12-15
CN107481311B true CN107481311B (en) 2021-04-13

Family

ID=60601300

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710733641.1A Active CN107481311B (en) 2017-08-24 2017-08-24 Three-dimensional city model rendering method and device

Country Status (1)

Country Link
CN (1) CN107481311B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416843A (en) * 2018-03-08 2018-08-17 浙江科澜信息技术有限公司 Three-dimensional scene construction method, device, equipment and computer readable storage medium
CN108830924B (en) * 2018-06-20 2022-06-10 福建省亿鑫海信息科技有限公司 Scene model display method and terminal
CN109299548B (en) * 2018-09-28 2023-09-01 中航安贞(浙江)信息科技有限公司 Network-oriented building information model data publishing and visualizing method
CN109461212A (en) * 2018-11-13 2019-03-12 浙江科澜信息技术有限公司 A kind of three-dimensional scenic method for refreshing, device, equipment and readable storage medium storing program for executing
CN109785422A (en) * 2018-12-19 2019-05-21 全球能源互联网研究院有限公司 The construction method and device of three-dimensional power grid scene
CN109712221B (en) * 2018-12-21 2022-08-16 成都四方伟业软件股份有限公司 Three-dimensional visualization rendering method and device
CN109801363B (en) * 2019-01-15 2023-05-02 浙江科澜信息技术有限公司 Display method, device and equipment of oblique photography model
CN110443893B (en) * 2019-08-02 2023-04-25 广联达科技股份有限公司 Large-scale building scene rendering acceleration method, system, device and storage medium
CN111950057A (en) * 2020-08-06 2020-11-17 万翼科技有限公司 Loading method and device of Building Information Model (BIM)
CN111968212B (en) * 2020-09-24 2024-05-03 中国测绘科学研究院 Viewpoint-based three-dimensional urban scene data dynamic scheduling method
CN112632679B (en) * 2020-12-30 2022-06-17 久瓴(江苏)数字智能科技有限公司 Building information model scene rendering method and device and computer equipment
CN113901062B (en) * 2021-12-07 2022-03-18 浙江高信技术股份有限公司 Pre-loading system based on BIM and GIS
CN116433821B (en) * 2023-04-17 2024-01-23 上海臻图信息技术有限公司 Three-dimensional model rendering method, medium and device for pre-generating view point index
CN116778129B (en) * 2023-08-18 2023-11-21 煤炭科学研究总院有限公司 Marking method and device for coal mine three-dimensional roadway page

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060191333A1 (en) * 2003-04-18 2006-08-31 Noe Stephen A Runoff rain gauge
CN102564508A (en) * 2011-12-14 2012-07-11 河海大学 Method for implementing online tests of stream flow based on video images
CN103942306A (en) * 2014-04-18 2014-07-23 重庆市勘测院 Three-dimensional city model self-adaption scheduling method
CN104751505A (en) * 2013-06-19 2015-07-01 国家电网公司 Three-dimensional scene rendering algorithm based on LOD (Levels of Detail) model and quadtree level structure

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060191333A1 (en) * 2003-04-18 2006-08-31 Noe Stephen A Runoff rain gauge
CN102564508A (en) * 2011-12-14 2012-07-11 河海大学 Method for implementing online tests of stream flow based on video images
CN104751505A (en) * 2013-06-19 2015-07-01 国家电网公司 Three-dimensional scene rendering algorithm based on LOD (Levels of Detail) model and quadtree level structure
CN103942306A (en) * 2014-04-18 2014-07-23 重庆市勘测院 Three-dimensional city model self-adaption scheduling method

Also Published As

Publication number Publication date
CN107481311A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
CN107481311B (en) Three-dimensional city model rendering method and device
CN108230453B (en) Automatically partitioning a 3D scene into multiple partitions for processing by computing resources
US7557803B2 (en) Method, computer program product and data structure for representing two- or three-dimensional object modeling
KR100970790B1 (en) Method of generating a computer readable model
EP1710720A1 (en) Method of computer-aided design of a modeled object having several faces
CN114627219A (en) Rendering method and device of three-dimensional scene data, storage medium and electronic device
CN107368612A (en) Quaternary tree index structuring method and device
CN113724401B (en) Three-dimensional model cutting method and device, computer equipment and storage medium
CN114708358B (en) Object processing method, device, equipment and computer readable storage medium
CN112328880A (en) Geographical region clustering method and device, storage medium and electronic equipment
CN105874511B (en) Analog machine
CN116246069B (en) Method and device for self-adaptive terrain point cloud filtering, intelligent terminal and storage medium
CN112337093B (en) Virtual object clustering method and device, storage medium and electronic device
CN111524446B (en) Data processing method and device, electronic equipment and readable storage medium
CN113591208A (en) Oversized model lightweight method based on ship feature extraction and electronic equipment
CN115205434B (en) Point cloud data visualization processing method and device
CN114782652B (en) Model leveling method, device, equipment and storage medium
CN116385652B (en) Parameterized geometric multithreading discrete method and system
CN117132738B (en) Spherical discrete grid multi-scale equidistant mode quantization method and system
CN117456112B (en) Pump station supervision method, system, electronic equipment and medium
US20150169804A1 (en) Simulation apparatus, controlling method, program and information storage medium for the simulation apparatus
US20150169803A1 (en) Simulation apparatus, controlling method, program and information storage medium for the simulation apparatus
CN115374229A (en) Map data processing method and device, electronic equipment and storage medium
KR101373174B1 (en) Method and apparatus of processing polygon data of spatial acceleration structure
CN117609524A (en) View analysis method, device and equipment based on three-dimensional R tree spatial index

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210322

Address after: 710199 no.216, Shenzhou 4th Road, national civil aerospace industry base, Xi'an City, Shaanxi Province

Applicant after: China coal (Xi'an) aerial survey and Remote Sensing Research Institute Co.,Ltd.

Applicant after: AERIAL PHOTOGRAMMETRY AND REMOTE SENSING Co.,Ltd.

Address before: 710000 Shenzhou four road 216, Xi'an Aerospace base, Shaanxi

Applicant before: AERIAL PHOTOGRAMMETRY AND REMOTE SENSING Co.,Ltd.

GR01 Patent grant
GR01 Patent grant