Summary of the invention
Embodiment of the present invention technical problem to be solved is, it is provided that a kind of threedimensional model rendering indication methodAnd threedimensional model renders display system, it is possible to resolve the defect of LOD strategy in prior art, it is adaptable in high precisionThe visualization of threedimensional model.
In order to solve above-mentioned technical problem, embodiment of the present invention first aspect discloses a kind of threedimensional model and rendersDisplay packing, including:
Positional information according to current view point, it is judged that in the threedimensional model of foundation, whether the root node of each sub-blockVisible;Described threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, is divided into multiple sub-block, and every heightBlock generates previously according to respective level and data amount information each self-corresponding self adaptation tree detailLOD;
According to described self adaptation tree LOD, start recursive traversal subtree from visible root node, according to level byLayer carries out visibility judge and LOD accuracy test to all nodes under described root node, draws satisfied visibleThe level that property is corresponding with the node of LOD required precision;
Load and meet the model data that the described level required is corresponding, threedimensional model is rendered display.
In conjunction with first aspect, in the implementation that the first is possible, by default meta data file to instituteState the essential information of threedimensional model, the tree structure information of described self adaptation tree LOD and each node wattSheet Tile information stores;
The described positional information according to current view point, it is judged that the root node of each sub-block in the threedimensional model of foundationBefore the most visible, also include: by asking described meta data file, internal memory is rebuild threedimensional modelThe tree structure that node is constituted.
In conjunction with the first possible implementation of first aspect, in the implementation that the second is possible, instituteState geometric data corresponding to the node in piecemeal and data texturing is stored by independent file respectively;
Described loading meets the model data that the described level of requirement is corresponding, and threedimensional model is rendered displayIncluding: according to the model data that the described level of the satisfied requirement drawn is corresponding, from described independent fileCarry out extracting and loading, threedimensional model is rendered display.
In conjunction with the first possible implementation of first aspect, in the implementation that the third is possible, sentenceBreak and in sub-block after visible root node, described according to described self adaptation tree LOD, from visible root nodeBefore starting recursive traversal subtree, also include:
Judge whether described visible root node identifies to draw;
When judged result is no, asks and draw described visible root node.
In conjunction with first aspect, in the 4th kind of possible implementation, described according to level successively to describedAll nodes under node carry out visibility judge and LOD accuracy test, draw and meet observability and LODThe level that the node of required precision is corresponding, including:
Using next hierarchy node of described visible root node as current hierarchy node, it is judged that described current levelNode is the most visible;
When judged result is for being, described current hierarchy node is carried out LOD accuracy test, analyse whether fullFoot LOD required precision;
When analysis result is for being, the most described current level is to meet observability and the node of LOD required precisionCorresponding level;When analysis result is no, then using next hierarchy node of described current hierarchy node asThe current hierarchy node updated, and repeat and described judge the described the most visible step of current hierarchy node,Until drawing and meeting the level that observability is corresponding with the node of LOD required precision.
In conjunction with first aspect, or the first possible implementation of first aspect, or first aspectThe implementation that the second is possible, or the third possible implementation of first aspect, or first partyThe 4th kind of possible implementation in face, in the 5th kind of possible implementation, when the position of described viewpointOr visual angle changes when needing to carry out scene switching, draw and meet observability and the node of LOD required precisionCorresponding level changes to level j from level i, and wherein said i and j is positive integer, and j is more than i;
The model data that described loading meets the described level of requirement corresponding includes:
The self adaptation tree LOD corresponding according to meeting the affiliated sub-block requiring node, analyzes described level i to instituteState and between level j, whether there is bifurcated tree;
When analysis result is no, across the model data that level j described in the direct request of loading of level is corresponding;Work as analysisWhen result is for being, request of loading is from the model data corresponding to described level i first bifurcated tree down.
In conjunction with the 5th kind of possible implementation of first aspect, in the 6th kind of possible implementation, addCarry the model data that described level j is corresponding, after completing threedimensional model is rendered display, by described last layerThe model data of level correspondence unloads.
In conjunction with the 5th kind of possible implementation of first aspect, in the 7th kind of possible implementation, whenNode in multiple sub-blocks needs simultaneously when level i changes to level j, and described loading meets the described of requirementThe model data that level is corresponding, including:
Judge whether the level quantity from level i to level j process arrives predetermined threshold value;
When judged result is for being, according to default wall progression, the pattern number that loaded floor by floor level is correspondingAccording to, and after the node of the plurality of sub-block all completes to load the model data that current level is corresponding, just intervalDescribed wall progression loads the model data that next level is corresponding.
Embodiment of the present invention second aspect discloses a kind of threedimensional model and renders display system, including:
Visible judge module, for the positional information according to current view point, it is judged that every in the threedimensional model of foundationThe root node of individual sub-block is the most visible;Described threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, is divided intoMultiple sub-blocks, and each sub-block generate previously according to respective level and data amount information have each self-corresponding fromAdapt to tree detail LOD;
Judge test module, for according to described self adaptation tree LOD, start recurrence time from visible root nodeGo through subtree, successively all nodes under described root node are carried out visibility judge and LOD precision according to levelTest, draws and meets the level that observability is corresponding with the node of LOD required precision;
Loaded and displayed module, for loading the model data that the described level meeting requirement is corresponding, to three-dimensional mouldType carries out rendering display.
In conjunction with second aspect, in the implementation that the first is possible, by default meta data file to instituteState the essential information of threedimensional model, the tree structure information of described self adaptation tree LOD and each node wattSheet Tile information stores;
Described system also includes:
Module is rebuild in request, at described visible judge module according to the positional information of current view point, it is judged thatBefore in the threedimensional model set up, the root node of each sub-block is the most visible, by asking described meta data file,The tree structure that the node of threedimensional model is constituted is rebuild in internal memory.
In conjunction with the first possible implementation of second aspect, in the implementation that the second is possible, instituteState geometric data corresponding to the node in piecemeal and data texturing is stored by independent file respectively;
Described loaded and displayed module is specifically for the pattern number corresponding according to the described level of satisfied requirement drawnAccording to, carry out extracting and loading from described independent file, threedimensional model is rendered display.
In conjunction with the first possible implementation of second aspect, in the implementation that the third is possible, alsoIncluding:
Draw judge module, for judging in sub-block after visible root node at described visible judge module,Described according to described self adaptation tree LOD, before visible root node starts recursive traversal subtree, it is judged that instituteState visible root node whether to identify and drew;
Request drafting module, for when the judged result of described drafting judge module is no, asks and drawsDescribed visible root node.
In conjunction with second aspect, in the 4th kind of possible implementation, described judgement test module includes:
Visible judging unit, is used for next hierarchy node of described visible root node as current hierarchy node,Judge that described current hierarchy node is the most visible;
Accuracy test analytic unit, for when the judged result of described visible judging unit is for being, to describedCurrent hierarchy node carries out LOD accuracy test, analyses whether to meet LOD required precision;
Analysis result processing unit, is used for when the analysis result of described accuracy test analytic unit is for being, thenDescribed current level is to meet the level that observability is corresponding with the node of LOD required precision;When described precision is surveyedWhen the analysis result of examination analytic unit is no, then using next hierarchy node of described current hierarchy node as moreNew current hierarchy node, and trigger described visible judging unit and repeat the described current level of described judgementThe most visible step of node, until drawing and meeting the level that observability is corresponding with the node of LOD required precision.
In conjunction with second aspect, or the first possible implementation of second aspect, or second aspectThe implementation that the second is possible, or the third possible implementation of second aspect, or second partyThe 4th kind of possible implementation in face, in the 5th kind of possible implementation, when the position of described viewpointOr visual angle changes when needing to carry out scene switching, described judgement test module draw meet observability andThe level that the node of LOD required precision is corresponding changes to level j from level i, and wherein said i and j is the most wholeNumber, and j is more than i;
Described loaded and displayed module includes:
Bifurcated tree analytic unit, for the self adaptation tree LOD corresponding according to meeting the affiliated sub-block requiring node,Analyze whether described level i exists bifurcated tree between described level j;
Analysis and processing unit, for when the analysis result of described bifurcated tree analytic unit is no, direct across levelThe model data that level j described in request of loading is corresponding;When the analysis result of described bifurcated tree analytic unit is yesTime, request of loading is from the model data corresponding to described level i first bifurcated tree down.
In conjunction with the 5th kind of possible implementation of second aspect, in the 6th kind of possible implementation, alsoIncluding:
Load shedding module, for being loaded with, in described analysis and processing unit, the pattern number that described level j is correspondingAccording to, after completing threedimensional model is rendered display, model data corresponding for described last layer level is unloaded.
In conjunction with the 5th kind of possible implementation of second aspect, in the 7th kind of possible implementation, whenNode in multiple sub-blocks needs simultaneously when level i changes to level j, and described loaded and displayed module includes:
Threshold decision unit, for judging whether the level quantity from level i to level j process arrives default thresholdValue;
Loaded floor by floor unit, for when the judged result of described threshold decision unit is for being, according to defaultWall progression, the model data that loaded floor by floor level is corresponding, and when the node of the plurality of sub-block all completesAfter loading the model data that current level is corresponding, being just spaced described wall progression, to load next level correspondingModel data.
The embodiment of the present invention third aspect discloses a kind of computer-readable storage medium, described computer-readable storage mediumHaving program stored therein, described program includes the of embodiment of the present invention first aspect or first aspect when performingA kind of possible implementation, or the implementation that the second of first aspect is possible, or first aspectThe third possible implementation, or the 4th kind of possible implementation of first aspect, or first5th kind of possible implementation of aspect, or the 6th kind of possible implementation of first aspect, orThe Overall Steps of the threedimensional model rendering indication method in the 7th kind of possible implementation of first aspect.
Implementing the embodiment of the present invention, threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, is divided into many heightBlock, and each sub-block generates previously according to respective level and data amount information and has each self-corresponding self adaptation treeLOD, just for the self adaptation tree LOD of visible sub-block, starts recursive traversal subtree from visible root node,Successively all nodes under described root node are carried out visibility judge and LOD accuracy test according to level,Go out to meet the level that observability is corresponding with the node of LOD required precision, it is to avoid simple piecemeal in prior artThe problem that when LOD causes when dividing too much sub-block drawing, frame per second can be decreased obviously, solves again prior artThe technical problem that display speed that middle self adaptation tree LOD must cause from root node request data step by step is slow;AndAnd tree construction can be created by the meta data file that request is preset, it is possible to achieve across level request target levelTile, it is not necessary to request data step by step, save a large amount of network request and data transmission, accelerate render aobviousShow speed and renewal speed.It addition, when the level quantity needing change of the multiple local of threedimensional model reaches pre-If threshold value, then according to default wall progression, the model data that loaded floor by floor level is corresponding, thus realizeThe synchronized update of the plurality of local, it is to avoid in threedimensional model, the display of some sub-blocks is very fine but another is a littleThe problem that the display of block is the most coarse, substantially increases and is quickly turned to overall visual effect clearly from fuzzy, carryRise threedimensional model and rendered the renewal efficiency of display, both can realize directly browsing at browser with WebGL,Also support to visualize with opengl ES exploitation App.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearlyChu, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather thanWhole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creationThe every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Being embodied as of threedimensional model rendering indication method of the present invention is described in detail below in conjunction with Fig. 3 to Fig. 6Mode, illustrates how to carry out threedimensional model and renders display:
Fig. 3 shows the schematic flow sheet of the threedimensional model rendering indication method that the embodiment of the present invention provides, bagInclude:
Step S300: according to the positional information of current view point, it is judged that each sub-block in the threedimensional model of foundationRoot node is the most visible;
Specifically, the threedimensional model in the embodiment of the present invention has carried out piecemeal according to three-dimensional coordinate direction, is divided intoMultiple sub-blocks, and each sub-block generate previously according to respective level and data amount information have each self-corresponding fromAdapt to tree detail LOD;The number of the block adaptive tree that the embodiment of the present invention as shown in Figure 4 providesAccording to structural representation, threedimensional model can be carried out initial piecemeal from three directions of x, y, z, be divided into i*j*K sub-block (block), i.e. can be divided into the sub-block of 2,4 or 8 etc., only to list in Fig. 4As a example by three sub-blocks (block 0, block 1 and block 2), the corresponding unique block identification blockID of the most each sub-block.Each sub-block can carefully form a self adaptation tree, the joint of each level with specific reference to level and data complexityPoint may have multiple, and therefore to also need to record self mark ID ability under current level unique for nodeIdentify a node, then the node of the different level of whole threedimensional model defines a forest shape (such as figureShown in 4)
It should be noted that the embodiment of the present invention is when making data, dividing of each node can be controlled as far as possibleProp up the fewest more good, so can improve loading efficiency.Furthermore it is also possible to control the initial piecemeal of threedimensional modelQuantity, it is to avoid reduce frame per second when drawing when viewable objects number is too much.
Step S302: according to described self adaptation tree LOD, start recursive traversal subtree from visible root node,Successively all nodes under described root node are carried out visibility judge and LOD accuracy test according to level,Go out to meet the level that observability is corresponding with the node of LOD required precision;
Specifically, for the sightless sub-block judged in step S300, it is not necessary to perform this sub-block lower nodeVisibility judge, step S302 is only to the visibility judge judging that visible sub-block lower node is made.In detailGround, according to self adaptation tree LOD, starts recursive traversal subtree from visible root node, according to level successively to instituteState all nodes under root node and carry out visibility judge and LOD accuracy test, when node had both met observabilityJudge, when reaching again the required precision of LOD accuracy test, then the level that this node is corresponding is to meet and wantsThe level asked, demonstrates the need for loading the model data that this level is corresponding, carries out rendering display;Such as according to layerLevel successively carries out visibility judge and LOD accuracy test to all nodes under described root node, until level7Node the most both met visibility judge, reach again the required precision of LOD accuracy test, then level7 is i.e.Level for satisfied requirement.
Step S304: load and meet the model data that the described level required is corresponding, threedimensional model is carried out wash with watercoloursDye display.
Specifically, such as show that the node under this root node needs to show level7's through the analysis of step S302Precision, then load the model data of node corresponding to the level7 under this root node, and complete three-dimensional mouldType render display.
Implementing the embodiment of the present invention, threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, is divided into many heightBlock, and each sub-block generates previously according to respective level and data amount information and has each self-corresponding self adaptation treeLOD, just for the self adaptation tree LOD of visible sub-block, starts recursive traversal subtree from visible root node,Successively all nodes under described root node are carried out visibility judge and LOD accuracy test according to level,Go out to meet the level that observability is corresponding with the node of LOD required precision, it is to avoid simple piecemeal in prior artThe problem that when LOD causes when dividing too much sub-block drawing, frame per second can be decreased obviously, solves again prior artThe technical problem that display speed that middle self adaptation tree LOD must cause from root node request data step by step is slow, carriesRise threedimensional model and render the renewal efficiency of display.
Further, the basic of described threedimensional model is believed by the embodiment of the present invention by the meta data file presetBreath, the tree structure information of described self adaptation tree LOD and the tile Tile information of each node store;And geometric data and data texturing that node in piecemeal is corresponding are stored by independent file respectively;Specifically:
Model data is stored by the embodiment of the present invention with tree structure unpack, and this model data includes eachGeometric data that node is corresponding and data texturing, tree structure information includes threedimensional model essential information, adaptiveThe tree structure information of LOD and the Tile information of each node should be set;Can be by the first number pre-buildStoring this tree structure information according to file, the threedimensional model essential information wherein stored can be with version number, outerBag, sub-block quantity, maximum level maxlevel;And the x, y, z of each sub-block that threedimensional model is divided intoThree-dimensional coordinate, identifies ID, the father node mark parentID of node subordinate, and outer package informatin etc..And it is eachThe geometric data that node is corresponding is used additionally with independent file record storage, the data texturing that each node is correspondingOne independent file record storage,
Yet further, another of threedimensional model rendering indication method provided in conjunction with the present invention shown in Fig. 5 aThe schematic flow sheet of embodiment, including:
Step S500: by request meta data file, rebuild the tree that the node of threedimensional model is constituted in internal memoryShape structure;
Specifically, the above-mentioned storage pre-set is asked to have the essential information of threedimensional model, self adaptation tree LODTree structure information and the meta data file of tile Tile information of each node, can weigh in internal memoryThe tree structure that the node of established model is constituted, i.e. node forest.
Step S502: according to the positional information of current view point, it is judged that each sub-block in the threedimensional model of foundationRoot node is the most visible;
Specifically, it is referred to step S300 in above-mentioned Fig. 3 embodiment, repeats no more here.
Step S504: judge whether described visible root node identifies and drew;
Specifically, can first judge whether visible root node identifies and draw, when judged result is no,It is out-of-date the most not draw, then perform step S506, can ask immediately and draw, so can ensure that userThreedimensional model can be seen rapidly.When judged result is for being, the most directly perform step S508.
Step S506: ask and draw described visible root node;
Step S508: according to described self adaptation tree LOD, start recursive traversal subtree from visible root node,Successively all nodes under described root node are carried out visibility judge and LOD accuracy test according to level,Go out to meet the level that observability is corresponding with the node of LOD required precision;
Specifically, it is referred to step S302 in above-mentioned Fig. 3 embodiment, repeats no more here.
Step S510: according to the model data that the described level of satisfied requirement is corresponding, from described independent fileIn carry out extracting and loading, threedimensional model is rendered display.
Specifically, such as, analyze through step S508 and show that certain node is level7 to the level in requisition for display,So there are the unique file of model data corresponding for this node level7 extraction model data from storage and carry outLoad, it will be understood that, the node correspondence level of all satisfied requirements is all carried out according to the mode of step S510Extract and load the model data of correspondence, be finally completed and threedimensional model is rendered display.
Yet further, the visibility judge provided in conjunction with the embodiment of the present invention shown in Fig. 5 b and LOD essenceThe method flow schematic diagram of degree test, describe in detail the present invention how according to level successively under described root nodeAll nodes carry out visibility judge and LOD accuracy test, including:
Step S5000: using next hierarchy node of described visible root node as current hierarchy node;
Specifically, start recursive traversal subtree from visible root node, by next level of this visible root nodeNode is as current hierarchy node.
Step S5002: judge that described current hierarchy node is the most visible;
Specifically, according to position and the visual angle of current view point, the observability algorithm preset is used to judge currentHierarchy node is the most visible, when judged result is for being, performs step S5004;When judged result is no,Then terminate to process, or only show this visible root node, or when this visible root node has next level multipleDuring node, respectively using other next hierarchy node as current hierarchy node, then perform step S5002.
Step S5004: described current hierarchy node is carried out LOD accuracy test, analyses whether to meet LODRequired precision;
Specifically, use the LOD accuracy test algorithm preset that current hierarchy node carries out LOD precision surveyExamination analyses whether to meet LOD required precision, when analysis result is for being, performs step S5006;Work as analysisWhen result is no, perform step S5008;
Step S5006: described current level is to meet the layer that observability is corresponding with the node of LOD required precisionLevel;
Step S5008: using next hierarchy node of described current hierarchy node as the current level joint updatedPoint;
Specifically, it is unsatisfactory for LOD required precision when analyzing current hierarchy node, i.e. needs to analyze current layerWhether next hierarchy node of level node meets observability and LOD required precision, then by current hierarchy nodeNext hierarchy node as update current hierarchy node, repeated execution of steps S5002, until draw satisfiedThe level that observability is corresponding with the node of LOD required precision.
Yet further, the side of the stress model data provided below in conjunction with the embodiment of the present invention shown in Fig. 6Method schematic flow sheet, explains when position or the visual angle of viewpoint change when needing to carry out scene switching,How to load and meet the model data that the described level required is corresponding, including:
Step S600: the self adaptation tree LOD corresponding according to meeting the affiliated sub-block requiring node, analyzes describedWhether level i exists bifurcated tree between described level j;
Specifically, when the position of viewpoint or visual angle change need to carry out scene switching time, show that meet canThe opinion property level corresponding with the node of LOD required precision changes to level j, wherein said i and j from level iFor positive integer, and j is more than i;So can be according to meeting the self adaptation tree requiring the affiliated sub-block of node correspondingLOD, i.e. according to the data structure schematic diagram of block adaptive tree of the present invention as shown in Figure 4, analyzes from layerWhether level i exists bifurcated tree between level j, when analysis result is no, then and execution step S602, otherwise,Perform step S604.
Step S602: across the model data that level j described in the direct request of loading of level is corresponding;
Specifically, when analyzing level i and there is not bifurcated tree to level j, level i can not be asked to layerTransit data between level j, across the model data of level direct request of loading level j, therefore when j is more than iTime, it is possible to have 1~n node data, wherein n=j-i, but only need to ask 1 node data, the most directlyThe model data of request of loading level j.
Step S604: request of loading is from the model data corresponding to described level i first bifurcated tree down.
Specifically, if changing to there is bifurcated tree between level j, such as from level i to level j from level iBetween exist two bifurcated trees, level i first bifurcated tree down is to level k, and second bifurcated tree arrivesLevel h, then first request is loaded directly into the model data that level k is corresponding, then request of loading is to level h pairThe model data answered, the model data that final request of loading to level j is corresponding.
Yet further, the embodiment of the present invention is being loaded with the model data that described level j is corresponding, completes threeDimension module render display after, model data corresponding for described last layer level is unloaded.The most such as go up oneLevel be leveli so after completing threedimensional model is rendered display, model data corresponding for leveli is enteredRow unloading.It should be noted that the model data that current level is corresponding is loaded by the embodiment of the present inventionAfter, model data corresponding for last layer level can be unloaded, to save internal memory and video memory consumption.
Yet further, need to change to level j from level i when the node needing display in multiple sub-blocks simultaneouslyTime, model data corresponding to the level that calculates described in the loading in the embodiment of the present invention can also include: sentencesWhether the disconnected level quantity from level i to level j process arrives predetermined threshold value;When judged result is for being, pressAccording to default wall progression, the model data that loaded floor by floor level is corresponding, and work as the plurality of sub-block needsAfter the node of display all completes to load the model data that current level is corresponding, just it is spaced described wall progression and addsCarry the model data that next level is corresponding.Specifically:
When the node needing display in multiple sub-blocks needs simultaneously to change to level j from level i, and model isWhen big level maxLevel is bigger, i.e. when the level quantity of level i to level j process is bigger, forThe sub-block avoided has requested that and shows fine data (level is bigger), and other sub-blocks are the most coarseThe problem of (level is less), the embodiment of the present invention can pre-set a threshold value, if this threshold value is 12,So when judging to arrive this predetermined threshold value 12 from the level quantity of level i to level j process, then pressAccording to default wall progression, the model data that loaded floor by floor level is corresponding;The wall progression 4 such as preset,And after the plurality of sub-block needs the node of display all to complete to load the model data that current level is corresponding,It is spaced described wall progression and loads the model data that next level is corresponding.Citing illustrates:
Assume that maxLevel=12, default wall progression are 4, and from level i to the layer of level j processNumber of stages is 14, and when i.e. reaching threshold value 12, the 0th, 4,8,12 is the important node that must show, i.e. whenFront frame is shown that the 0th hierarchical data, and the display target of next frame is the 14th hierarchical data, then the present inventionAfter embodiment needs the node waiting each sub-block all to ask and show the model data of level=4, and labelling itsAfter display, then ask the data of the level=8 of all of sub-block, after having shown, ask the 12nd grade againData, and ask the data of the level=14 of all of sub-block after showing the model data of level=12 again, fromAnd the sub-block avoided has shown that the 14th grade, and some sub-blocks are also the situation of the 0th grade.
It should be noted that the predetermined threshold value of the embodiment of the present invention is not limited to 12, it is also possible to be 14,16 etc.,Can be configured according to the experience of user or concrete condition, the present invention is not restricted;The wall presetProgression is also not necessarily limited to 4, it is also possible to being set to 3 or 5 etc., the present invention is not restricted.Preferably, the present inventionThe wall progression preset in embodiment is not more than 4, it is also possible to be 2 or 3 etc., to avoid three-dimensional modeling dataDuring display, precision is crossed over serious, affects display effect.
Implementing the embodiment of the present invention, threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, is divided into many heightBlock, and each sub-block generates previously according to respective level and data amount information and has each self-corresponding self adaptation treeLOD, just for the self adaptation tree LOD of visible sub-block, starts recursive traversal subtree from visible root node,Successively all nodes under described root node are carried out visibility judge and LOD accuracy test according to level,Go out to meet the level that observability is corresponding with the node of LOD required precision, it is to avoid simple piecemeal in prior artThe problem that when LOD causes when dividing too much sub-block drawing, frame per second can be decreased obviously, solves again prior artThe technical problem that display speed that middle self adaptation tree LOD must cause from root node request data step by step is slow;AndAnd tree construction can be created by the meta data file that request is preset, it is possible to achieve across level request target levelTile, it is not necessary to request data step by step, save a large amount of network request and data transmission, accelerate render aobviousShow speed and renewal speed.It addition, when the level quantity needing change of the multiple local of threedimensional model reaches pre-If threshold value, then according to default wall progression, the model data that loaded floor by floor level is corresponding, thus realizeThe synchronized update of the plurality of local, it is to avoid in threedimensional model, the display of some sub-blocks is very fine but another is a littleThe problem that the display of block is the most coarse, substantially increases and is quickly turned to overall visual effect clearly from fuzzy, carryRise threedimensional model and rendered the renewal efficiency of display, both can realize directly browsing at browser with WebGL,Also support to visualize with opengl ES exploitation App.
For the ease of preferably implementing the such scheme of the embodiment of the present invention, the present invention also correspondence provides oneThreedimensional model renders display system, and the threedimensional model that the embodiment of the present invention as shown in Figure 7 provides renders displayThe structural representation of system, threedimensional model render display system 70 may include that visible judge module 700,Judge test module 702 and loaded and displayed module 704, wherein
Visible judge module 700 is for the positional information according to current view point, it is judged that in the threedimensional model of foundationThe root node of each sub-block is the most visible;Described threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, pointBecome multiple sub-block, and each sub-block has each self-corresponding previously according to respective level and data amount information generationSelf adaptation tree detail LOD;
Judge that test module 702, for according to described self adaptation tree LOD, starts recurrence from visible root nodeAll nodes under described root node are successively carried out visibility judge and LOD essence by traversal subtree according to levelDegree test, draws and meets the level that observability is corresponding with the node of LOD required precision;
Loaded and displayed module 704 is for loading the model data that the described level meeting requirement is corresponding, to three-dimensionalModel carries out rendering display.
Specifically, the embodiment of the present invention passes through the default meta data file essential information to described threedimensional model,The tree structure information of described self adaptation tree LOD and the tile Tile information of each node store;AsThe threedimensional model that the present invention shown in Fig. 8 provides renders the structural representation of another embodiment of display system,Threedimensional model renders display system 70 and includes visible judge module 700, judge test module 702 and load aobviousShow outside module 704, it is also possible to include that module 706 is rebuild in request, be used at visible judge module 700 according to working asThe positional information of front viewpoint, it is judged that before the root node of each sub-block is the most visible in the threedimensional model of foundation,By asking described meta data file, internal memory is rebuild the tree structure that the node of threedimensional model is constituted.
Further, the node in embodiment of the present invention piecemeal is corresponding geometric data and data texturing lead to respectivelyCross independent file to store;Loaded and displayed module 704 specifically may be used for meeting requirement according to drawModel data corresponding to described level, carry out extracting and loading, to three from described independent fileDimension module carries out rendering display.
Yet further, the threedimensional model that the present invention as shown in Figure 9 provides renders another reality of display systemExecuting the structural representation of example, threedimensional model renders display system 70 and includes visible judge module 700, judges to surveyDie trial block 702, loaded and displayed module 704 and request are rebuild outside module 706, it is also possible to include that drafting judges mouldBlock 708 and request drafting module 7010, wherein
Draw judge module 708 for visible judge module 700 judge in sub-block visible root node itAfter, described according to described self adaptation tree LOD, before visible root node starts recursive traversal subtree, sentenceWhether disconnected described visible root node identifies was drawn;
Request drafting module 7010 is for when the judged result drawing judge module 708 is no, asking and paintMake described visible root node.
Yet further, the structural representation judging test module that the embodiment of the present invention as shown in Figure 10 providesFigure, it is judged that test module 702 can include visible judging unit 7020, accuracy test analytic unit 7022 andAnalysis result processing unit 7024, wherein
Visible judging unit 7020 is for saving next hierarchy node of described visible root node as current levelPoint, it is judged that described current hierarchy node is the most visible;
Accuracy test analytic unit 7022 is for when the judged result of visible judging unit 7020 is for being, rightDescribed current hierarchy node carries out LOD accuracy test, analyses whether to meet LOD required precision;
Analysis result processing unit 7024 is used for when the analysis result of accuracy test analytic unit 7022 is for being,The most described current level is to meet the level that observability is corresponding with the node of LOD required precision;Work as accuracy testWhen the analysis result of analytic unit 7022 is no, then using next hierarchy node of described current hierarchy node asThe current hierarchy node updated, and trigger visible judging unit 7020 and repeat the described current layer of described judgementThe level the most visible step of node, until drawing and meeting the layer that observability is corresponding with the node of LOD required precisionLevel.
Specifically, the embodiment of the present invention judging, test module 702 calculates the node needing to show correspondingLevel includes: when position or the visual angle of described viewpoint change when needing to carry out scene switching, draw satisfiedThe observability level corresponding with the node of LOD required precision changes to level j from level i, wherein said i andJ is positive integer, and j is more than i;The knot of the loaded and displayed module that the embodiment of the present invention as shown in Figure 11 providesStructure schematic diagram, loaded and displayed module 704 can include bifurcated tree analytic unit 7040 and analysis and processing unit7042, wherein
Bifurcated tree analytic unit 7040 is for the self adaptation tree corresponding according to meeting the affiliated sub-block requiring nodeLOD, analyzes whether described level i exists bifurcated tree between described level j;
Analysis and processing unit 7042 is for when the analysis result of bifurcated tree analytic unit 7040 is no, across levelThe model data that directly level j described in request of loading is corresponding;When the analysis result of bifurcated tree analytic unit 704 isWhen being, request of loading is from the model data corresponding to described level i first bifurcated tree down.
Yet further, the threedimensional model that the present invention as shown in Figure 12 provides renders another reality of display systemExecuting the structural representation of example, threedimensional model renders display system 70 and includes visible judge module 700, judges to surveyDie trial block 702, loaded and displayed module 704, request are rebuild module 706, are drawn judge module 708 and requestOutside drafting module 7010, it is also possible to include load shedding module 7012, in loaded and displayed module 704Analysis and processing unit 7042 be loaded with the model data that described level j is corresponding, complete the wash with watercolours to threedimensional modelAfter dye display, model data corresponding for described last layer level is unloaded.
Yet further, the knot of another embodiment of the loaded and displayed module that the present invention as shown in Figure 13 providesStructure schematic diagram, loaded and displayed module 704 includes bifurcated tree analytic unit 7040 and analysis and processing unit 7042Outward, it is also possible to include threshold decision unit 7044 and loaded floor by floor unit 7046, wherein
Threshold decision unit 7044 is for needing when the node needing display in multiple sub-blocks simultaneously from the change of level iWhen changing to level j, it is judged that whether arrive predetermined threshold value from the level quantity of level i to level j process;
Loaded floor by floor unit 7046 is for when the judged result of threshold decision unit 7044 is for being, according in advanceIf wall progression, the model data that loaded floor by floor level is corresponding, and when the plurality of sub-block need displayNode all complete to load the model data that current level is corresponding after, be just spaced described wall progression load underThe model data that one level is corresponding.
It should be noted that modules in the embodiment of the present invention or unit can think single module orUnit, can be again multiple module or unit organic integration together, such as visible judge module 700 and sentencingDisconnected test module 702 gathers together, and composition scheduling data request module etc., the present invention is not restricted.
Referring to Figure 14, Figure 14 is another embodiment that the threedimensional model that the present invention provides renders display systemStructural representation.Wherein, as shown in figure 14, threedimensional model renders display system 140 and may include that at leastOne processor 1401, such as CPU, at least one network interface 1404, user interface 1403, storageDevice 1405, at least one communication bus 1402 and display screen 1406.Wherein, communication bus 1402 is used forRealize the connection communication between these assemblies.Wherein, user interface 1403 can include keyboard or mouse etc..Network interface 1404 optionally can include the wireline interface of standard, wave point (such as WI-FI interface).Memorizer 1405 can be high-speed RAM memorizer, it is also possible to be non-labile memorizer (non-volatileMemory), for example, at least one disk memory, memorizer 1405 includes the flash in the embodiment of the present invention.Memorizer 1405 optionally can also is that at least one is located remotely from the storage system of aforementioned processor 1401.As shown in figure 14, as the memorizer 1405 of a kind of computer-readable storage medium can include operating system,Network communication module, Subscriber Interface Module SIM and threedimensional model render display program.
Processor 1401 may be used for calling the threedimensional model of storage in memorizer 1405 and renders display program,And operation below performing:
Positional information according to current view point, it is judged that in the threedimensional model of foundation, whether the root node of each sub-blockVisible;Described threedimensional model has carried out piecemeal according to three-dimensional coordinate direction, is divided into multiple sub-block, and every heightBlock generates previously according to respective level and data amount information each self-corresponding self adaptation tree detailLOD;
According to described self adaptation tree LOD, start recursive traversal subtree from visible root node, according to level byLayer carries out visibility judge and LOD accuracy test to all nodes under described root node, draws satisfied visibleThe level that property is corresponding with the node of LOD required precision;
Load and meet the model data that the described level required is corresponding, threedimensional model is rendered display.
Specifically, by the default meta data file essential information to described threedimensional model, described self adaptationThe tree structure information of tree LOD and the tile Tile information of each node store;
Processor 1401 is according to the positional information of current view point, it is judged that each sub-block in the threedimensional model of foundationBefore root node is the most visible, it is also possible to perform: by asking described meta data file, rebuild in internal memoryThe tree structure that the node of threedimensional model is constituted.
Further, the node in described piecemeal is corresponding geometric data and data texturing pass through independent respectivelyFile stores;
Load described in processor 1401 and meet the model data that the described level required is corresponding, threedimensional model is enteredRow renders display and includes: according to the model data that the described level of the satisfied requirement drawn is corresponding, from described solelyVertical file carries out extracting and loading, threedimensional model is rendered display.
Further, processor 1401 is judged in sub-block after visible root node, described in described basis certainlyAdapt to tree LOD, before visible root node starts recursive traversal subtree, it is also possible to perform:
Judge whether described visible root node identifies to draw;
When judged result is no, asks and draw described visible root node.
Further, all nodes under described root node are successively carried out visible according to level by processor 1401Property judge and LOD accuracy test, draw and meet the level that observability is corresponding with the node of LOD required precision,May include that
Using next hierarchy node of described visible root node as current hierarchy node, it is judged that described current levelNode is the most visible;When judged result is for being, described current hierarchy node is carried out LOD accuracy test,Analyse whether to meet LOD required precision;When analysis result is for being, the most described current level is visible for meetingThe level that property is corresponding with the node of LOD required precision;When analysis result is no, then by described current levelNext hierarchy node of node is as the current hierarchy node updated, and it is described currently to repeat described judgementThe most visible step of hierarchy node, until showing that to meet observability corresponding with the node of LOD required precisionLevel.
Further, when position or the visual angle of described viewpoint change when needing to carry out scene switching, drawThe level meeting observability corresponding with the node of LOD required precision changes to level j from level i, wherein saidI and j is positive integer, and j is more than i;
Processor 1401 loads the model data meeting the described level required corresponding and includes:
The self adaptation tree LOD corresponding according to meeting the affiliated sub-block requiring node, analyzes described level i to instituteState and between level j, whether there is bifurcated tree;
When analysis result is no, across the model data that level j described in the direct request of loading of level is corresponding;Work as analysisWhen result is for being, request of loading is from the model data corresponding to described level i first bifurcated tree down.
Further, processor 1401 is loaded with the model data that described level j is corresponding, completes three-dimensional mouldType render display after, model data corresponding for described last layer level is unloaded.
Further, when the node in multiple sub-blocks needs to change to level j from level i simultaneously, processor1401 load the model data that the satisfied described level required is corresponding, including:
Judge whether the level quantity from level i to level j process arrives predetermined threshold value;
When judged result is for being, according to default wall progression, the pattern number that loaded floor by floor level is correspondingAccording to, and after the plurality of sub-block needs the node of display all to complete to load the model data that current level is corresponding,Just it is spaced described wall progression and loads the model data that next level is corresponding.
It should be noted that the threedimensional model in the embodiment of the present invention renders display system 70 or threedimensional model wash with watercoloursThe function of each functional module of dye display system 140 can implement according to the method in said method embodiment,It implements process and is referred to the associated description of said method embodiment, and here is omitted.Three-dimensional mouldType renders display system 70 or threedimensional model render display system 140 can include but not limited to mobile phone,Removable computer, panel computer, personal digital assistant, media player, intelligent television, intelligent watch, intelligenceCan the electronic equipment such as glasses, Intelligent bracelet.
In sum, implementing the embodiment of the present invention, threedimensional model has carried out piecemeal according to three-dimensional coordinate direction,It is divided into multiple sub-block, and each sub-block generates previously according to respective level and data amount information and has respective correspondenceSelf adaptation tree LOD, just for the self adaptation tree LOD of visible sub-block, start recurrence from visible root nodeTraversal subtree, calculate and load level corresponding to node needing display, it is to avoid simple in prior artThe problem that when piecemeal LOD causes when dividing too much sub-block drawing, frame per second can be decreased obviously, solves again existingIn technology, self adaptation tree LOD must ask from the technology that the display speed that root node request data step by step causes is slowTopic;And tree construction can be created by the meta data file that request is preset, it is possible to achieve ask mesh across levelThe Tile of mark level, it is not necessary to request data step by step, saves a large amount of network request and data transmission, acceleratesRender display speed and renewal speed.It addition, when the number of levels needing change of the multiple local of threedimensional modelAmount reaches predetermined threshold value, then according to default wall progression, and the model data that loaded floor by floor level is corresponding,Thus realize the synchronized update of the plurality of local, it is to avoid in threedimensional model the display of some sub-blocks very fine butThe problem that the display of other sub-blocks is the most coarse, substantially increases and is quickly turned to overall vision clearly from fuzzyEffect, improves threedimensional model and renders the renewal efficiency of display, both can realize straight at browser with WebGLConnect and browse, also support to visualize with opengl ES exploitation App.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method,Can be by computer program and complete to instruct relevant hardware, described program can be stored in a calculatingIn machine read/write memory medium, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory,Or random store-memory body (Random Access Memory, RAM) etc. ROM).
Above disclosed be only present pre-ferred embodiments, certainly can not with this limit the present invention itInterest field, the equivalent variations therefore made according to the claims in the present invention, still belong to the scope that the present invention is contained.