A kind of comprehensive dynamic dispatching method of threedimensional model
Technical field
The present invention relates to a kind of comprehensive dynamic dispatching method of threedimensional model, belong to three-dimension virtual reality scheduling field.
Background technology
The projection pattern of conventional two-dimensional map determines must be with abstract symbolic formulation atural object, it is impossible to experiencing intuitively to people, especially terrain surface specifications complexity when, two-dimensional map is difficult to accurately reflect earth's surface information.But, on this problem, three-dimensional virtual reality technology disclosure satisfy that the needs of people just.
Current virtual reality technology, it is necessary first to set up threedimensional model, then carries out unifying or burst disposably completes to load, and can realize three-dimensional range.But three-dimensional modeling data amount is huge, it is desirable to accomplish the effect of smooth roaming, the hardware configuration of computer is required higher.
Under the new trend of information age, smart mobile phone and Open Source Platform are constantly popularized, although there is a big difference for the hardware condition of mobile device and computer, but it has innate advantage portable, moveable.Along with big data real-time rendering and the development of Real-Time Scheduling technology, mobile device hardware configuration constantly promotes, and shows that three-dimensional scenic is increasingly becoming possibility on embedded device.But by mobile terminal hardware limitations and the double influence of three-dimensional scenic complexity, the very three-dimensional large scene smooth operation the in mobile terminal yet suffers from the biggest difficulty.
Summary of the invention
Present invention solves the technical problem that and be: existing very three-dimensional large scene cannot be in the deficiency of the smooth and easy operation of mobile terminal.Invention proposes a kind of comprehensive dynamic dispatching method of threedimensional model, it is possible to achieve the more effective real-time rendering of threedimensional model and scheduling, breaches the constraint of mobile device hardware condition, thus is that very three-dimensional large scene smooth operation on mobile terminals has established technical foundation.
In order to solve above-mentioned technical problem, the technical scheme that the present invention proposes is a kind of comprehensive dynamic dispatching method of threedimensional model, comprises the following steps:
S1, at least set up subtle three-dimensional model, rough threedimensional model for each object;
S2, described threedimensional model have four-stage: the first stage does not loads, second stage is loaded as memory mirror, phase III release resource bag, fourth stage instantiation;When model is in instantiation state, correspondence object becomes visible, otherwise corresponding object is invisible;
S3, centered by current camera position, according to distance from closely to rudimentary district in middle rank district, the cone in senior district, the cone in far cone inner region being divided into the cone;Equally, according to distance from closely to far cone outskirt being divided into senior district the cone, the cone outer middle rank district, the outer rudimentary district of the cone;
S4, according to the position relationship of zoning in object and S3, threedimensional model is carried out dynamic dispatching, scheduling result meets following condition:
When object is positioned at the rudimentary district of the cone, and its subtle three-dimensional module scheduling is to second stage;
When object is positioned at cone middle rank district, and corresponding rough threedimensional model is dispatched to fourth stage, and corresponding subtle three-dimensional module scheduling is to the phase III;
When object is positioned at the senior district of the cone, and corresponding rough threedimensional model is dispatched to other either phase in addition to fourth stage, and corresponding subtle three-dimensional module scheduling is to fourth stage;
When object is positioned at the outer senior district of the cone, and corresponding subtle three-dimensional module scheduling is to the phase III;
When object is positioned at the cone outer middle rank district, and corresponding subtle three-dimensional module scheduling is to second stage;
When object is positioned at the outer rudimentary district of the cone, and corresponding subtle three-dimensional module scheduling is to the first stage.
Owing to rough three-dimensional modeling data amount is less, to its load, unload consumed resource extremely limited, therefore simple model can with transition formula loading or transition formula unload, therefore the present invention does not carry out strict restriction to the stage residing for it.
Differentiation to threedimensional model rough in step S4 below carries out the citing of preferred version, but the differentiation of rough threedimensional model is not limited to following process.
As preferred scheme, in step S4, rough threedimensional model being carried out dynamic dispatching, scheduling result meets following condition:
When object is positioned at the rudimentary district of the cone, its rough threedimensional model is dispatched to second or the phase III;
When object is positioned at the senior district of the cone, corresponding rough threedimensional model is dispatched to second or the phase III;
When object is positioned at the outer senior district of the cone, and corresponding rough threedimensional model is dispatched to first stage or second stage;
When object is positioned at the cone outer middle rank district, and corresponding rough threedimensional model is dispatched to first stage or second stage;
When object is positioned at the outer rudimentary district of the cone, and corresponding rough threedimensional model is dispatched to the first stage.
Further, in step S3 of the present invention, in the cone, outside the outward flange in senior district, the cone, the outward flange in senior district is equal to the distance of current camera position;In the cone, outside the middle rank outward flange in district, the cone, the outward flange in middle rank district is equal to the distance of current camera position;In the cone, outside the outward flange in rudimentary district, the cone, the outward flange in rudimentary district is equal to the distance of current camera position.
Further, in step S4 of the present invention, when object is positioned at the senior district of the cone and is in and closely cuts out rear, face, then corresponding subtle three-dimensional module scheduling is to the phase III;Corresponding rough threedimensional model is dispatched to other either phase in addition to fourth stage.
In order to reduce operand, it is proposed that using the model that size is less, actual object is divided into some subelements by the present invention, and then sub-unit sets up threedimensional model.Therefore, object described in step S1 of the present invention is the subelement of real world object segmentation.
The present invention, according to the feature in district each inside and outside the cone, carries out dynamic dispatching in conjunction with threedimensional model state in internal memory.In the cone, nearby region (senior district in the cone) is high to models show detail, therefore only refined model is being carried out instantiation (after instantiation, object is visible) in this region, meet the high accuracy of closer object during three-dimensional visualization, and other remaining the most do not carry out refined model and carry out instantiation, therefore resource occupation is greatly reduced, reduces the requirement to system;And distance areas (middle rank district in the cone) is low to models show detail in the cone, therefore present with the instantiation of simple model in this region, it is possible to meet the requirement of three-dimensional visualization;From the process of whole dynamic dispatching it can be seen that when three-dimensional visualization roams, substantial portion of object is positioned at the outer rudimentary district of the cone, and corresponding model is in first stage non-stress state, is not take up any memory source, therefore reduces ample resources consumption.The visible present invention, on the premise of guaranteeing the smooth and easy operation of three-dimensional visualization, significantly reduces system requirements.
The present invention is directed to each object and set up refined model and simple model respectively, to carrying out subregion inside and outside the cone, and according in subregion each during three-dimensional visualization to display requirement, and conversion process should meet the requirement of fluency and carries out threedimensional model dynamic dispatching between each subregion, it is few that it takies resource, operational efficiency is high, uses the three-dimensional visualization scheme of dynamic dispatching technology of the present invention to ensure that virtual reality system smooth operation on mobile terminals.
To sum up, the present invention breaches the restriction of hardware to a certain extent, significantly reduce three-dimension interaction scene to video memory and the consumption of internal memory, make mobile device end run true three-dimensional detail model large scene to be possibly realized, this invention may be directly applied to PC(Personal Computer) transformation of client three-dimensional virtual scene and optimization, it is achieved scene is to the transplanting of mobile terminal.
Accompanying drawing explanation
Below in conjunction with the accompanying drawings the comprehensive dynamic dispatching method of threedimensional model of the present invention is described further.
Fig. 1 is the cone of the present invention inside and outside subregion schematic diagram.
Detailed description of the invention
Below in conjunction with the accompanying drawings and the present invention program is described further by embodiment, but the present invention program is not limited to the present embodiment.
The comprehensive dynamic dispatching method of the present embodiment threedimensional model, comprises the following steps:
S1, set up subtle three-dimensional model, rough threedimensional model for each object;
In order to reduce operand, it is proposed that using the model that size is less, actual object is divided into some subelements by the present invention, and then sub-unit sets up threedimensional model.I.e. object described in step S1 is the subelement of real world object segmentation;
S2, subtle three-dimensional model and rough threedimensional model all have four-stage: the first stage does not loads, second stage is loaded as memory mirror, phase III release resource bag, fourth stage instantiation;When model is in instantiation state, correspondence object becomes visible, otherwise corresponding object is invisible;
S3 is as it is shown in figure 1, centered by current camera position, according to distance from closely to rudimentary district V-III in middle rank district V-II, the cone in senior district V-I, the cone in far cone inner region being divided into the cone;Equally, according to distance from closely to far cone outskirt being divided into senior district N-I the cone, the cone outer middle rank district N-II, the outer rudimentary district N-III of the cone;As shown in Figure 1, in the present embodiment, in the cone, outside the outward flange of senior district V-I, the cone, the outward flange of senior district N-I is equal to the distance of current camera position;In the cone, outside the middle rank outward flange of district V-II, the cone, the outward flange of middle rank district N-II is equal to the distance of current camera position;In the cone, outside the outward flange of rudimentary district V-III, the cone, the outward flange of rudimentary district N-III is equal to the distance of current camera position;
S4, according to the position relationship of zoning in object and S3, threedimensional model is carried out dynamic dispatching, scheduling result meets following condition:
When object is positioned at the cone rudimentary district V-III, and its subtle three-dimensional module scheduling is to second stage;
When object is positioned at cone middle rank district V-II, and corresponding rough threedimensional model is dispatched to fourth stage, and corresponding subtle three-dimensional module scheduling is to the phase III;
When object is positioned at the cone senior district V-I, and corresponding rough threedimensional model is dispatched to other either phase in addition to fourth stage, and corresponding subtle three-dimensional module scheduling is to fourth stage;
When object is positioned at the outer senior district N-I of the cone, and corresponding subtle three-dimensional module scheduling is to the phase III;
When object is positioned at the cone outer middle rank district N-II, and corresponding subtle three-dimensional module scheduling is to second stage;
When object is positioned at the outer rudimentary district N-III of the cone, and corresponding subtle three-dimensional module scheduling is to the first stage;
When object is positioned at the cone senior district V-I and is in and closely cuts out L rear, face, then corresponding subtle three-dimensional module scheduling is to the phase III;Corresponding rough threedimensional model is dispatched to other either phase in addition to fourth stage.
Not having strict restriction to the scheduling of simple model in multiple regions, but need to meet: when object is positioned at cone middle rank district V-II, the object that rough threedimensional model is corresponding is visible (i.e. rough threedimensional model is in fourth stage instantiation time);When object is positioned at other remaining stages, the object that rough threedimensional model is corresponding is invisible, therefore schedulable is to any stage in addition to fourth stage.
In the present embodiment, rough threedimensional model carrying out dynamic dispatching and has been also carried out citing, scheduling result meets following condition:
When object is positioned at the cone rudimentary district V-III, and its rough threedimensional model is dispatched to second stage;
When object is positioned at the cone senior district V-I, and corresponding rough threedimensional model is dispatched to second stage;
When object is positioned at the outer senior district N-I of the cone, and corresponding rough threedimensional model is dispatched to the first stage;
When object is positioned at the cone outer middle rank district N-II, and corresponding rough threedimensional model is dispatched to the first stage;
When object is positioned at the outer rudimentary district N-III of the cone, and corresponding rough threedimensional model is dispatched to the first stage.
Below by video camera straight forward target object from as far as near the most again to as a example by the order at rear, dispatching method of the present invention is illustrated.
First, object is positioned at the cone rudimentary district V-III, and now, corresponding subtle three-dimensional model, rough threedimensional model are dispatched to second stage from the first stage;
In the object entrance cone during middle rank district V-II, corresponding rough threedimensional model is dispatched to fourth stage, simple model instantiation from second stage transition, and simple model is visible, and corresponding subtle three-dimensional model is dispatched to the phase III from second stage;
As senior district V-I in object enters the cone, corresponding subtle three-dimensional model is dispatched to fourth stage, refined model instantiation from the phase III, and refined model is visible;Meanwhile, rough threedimensional model is dispatched to second stage from fourth stage, and simple model transfers to invisible;
When object enters in the cone senior district V-I and is in and closely cuts out L rear, face, then corresponding subtle three-dimensional module scheduling is to the phase III, rough threedimensional model is dispatched to second stage, the object in L front, face is closely cut out owing to camera setting can only photograph, therefore object once " moves " to closely cutting out L rear, face, then be invisible;
When object is positioned at the outer senior district N-I of the cone, and corresponding subtle three-dimensional module scheduling is to the phase III, and rough threedimensional model is dispatched to the first stage;
When object is positioned at the cone outer middle rank district N-II, corresponding subtle three-dimensional module scheduling to second stage, and corresponding rough threedimensional model is dispatched to the first stage;
When object is positioned at the outer rudimentary district N-III of the cone, and corresponding subtle three-dimensional model, rough threedimensional model are dispatched to the first stage.
The inventive method is not limited to the concrete technical scheme described in above-described embodiment, and the technical scheme that all employing equivalents are formed is the protection domain of application claims.