A kind of differential mode scale Forest Scene construction method of the same race and system
Technical field
The present invention relates to scenario building field, more particularly to a kind of differential mode scale Forest Scene construction method of the same race and system.
Background technology
Forest is common scene in nature, and indispensable role is play in various outdoor large scale scenes.
In computer realm, with continuing to develop for the technologies such as virtual reality, 3D game, demand of the user to Realistic Images of Virtual Scene
Growing day by day, this causes also growing day by day to building the demand of large-scale virtual visualization scale Forest Scene.But due to trees
Form of diverse, complex structure, the difficulty and cost of modeling are greatly improved therewith;Simultaneously as in scale Forest Scene trees quantity
Many, the data volume of system input is very huge, causes the efficiency for rendering to decline to a great extent therewith, it is difficult to obtain smoothness in the application
Expression.This is disagreed with the demand for experience that user increasingly improves.
The method that current main flow generates extensive scale Forest Scene is the editor based on single tree wood rule, after to editor
Parameter carry out random perturbation, so as to generate the tree modelling of differential mode of the same race.But this method has following weak point:
(1) modeling period is long:Due to the complexity of this body structure of trees, modeling personnel generally require the long period could structure
Build a collection of extensive scale Forest Scene for coming in every shape.
(2) high cost:Modeling personnel need the long period learn understand Tree vigorous degree rule in each parameter implication and
Tree vigorous degree software operating technology, i.e. learning cost is higher.Even needing many art designing personnel wastes time and energy and forest could be built
The task of mould is completed, and certainly will so cause (manpower) cost of modeling also higher.
(3) diversity is poor:It is big to generate that game at present uses the reuse means in units of whole tree modelling with VR
Scale forest, although enough light weights, but the diversity of trees form then wretched insufficiency, so its aesthetics is equal with authenticity
Extremely it is short of.
(4) calculating is rendered slow:Although employing based on the lightweight Tree vigorous degree for reusing, opening for network transmission is reduced
Pin, but when having arrived webpage client and rendering, each tree modelling still can only be represented with independent intensive polygonal patch,
The data volume rendered required for it is not reduced still but with amount of calculation, then the online effect for rendering of the extensive forests of Web3D
Rate is still very low, and the experience to user is also poor.
The content of the invention
The purpose of the present invention is exactly to provide one kind for the defect for overcoming above-mentioned prior art to exist.
The purpose of the present invention can be achieved through the following technical solutions:
It is an object of the invention to provide it is a kind of rapid modeling can be carried out to extensive forest and efficiently render it is of the same race different
State scale Forest Scene construction method and system.
To achieve the above object, the invention provides following scheme:
A kind of differential mode scale Forest Scene construction method of the same race, methods described includes:
The 3D models of collection single tree wood;
Using annulus patterning method by the model skeletonizing, the skeletonizing data of the model are obtained, in the skeletonizing
In data, each limb is represented with annulus sequence of the multiple with radius and direction;
The model is layered;
The delivery rules parameter of morphologic description parameter and adjacent interlayer in layer is calculated according to the skeletonizing data;
Calculate the Gaussian Profile value and variance of morphologic description parameter in each layer;
Calculate the Gaussian Profile value and variance of the delivery rules parameter of each adjacent interlayer;
According to the Gaussian Profile value and side of morphologic description parameter in the layer and the delivery rules parameter of the adjacent interlayer
Difference carries out random perturbation to the delivery rules parameter of morphologic description parameter in the layer and the adjacent interlayer, after being disturbed
Parameter value;
The trunk of different attitudes is generated according to the parameter value after the disturbance, the trunk of the different attitudes constitutes the mould
The component set of type;
Select the trees in scale Forest Scene described in the limb combination producing in the component set.
Optionally, the model skeletonizing is obtained the skeletonizing data of the model by the use annulus patterning method, tool
Body includes:
Using the plane of different directions to the tri patch of the model specified location and adjacent with the tri patch
Dough sheet cut;
The broken line on tri patch obtained in once cutting is connected, the broken line loop closed;
Judge whether the broken line loop reaches preset value with circular similarity, if it is, this time cut effectively, will
Annulus obtained by this time cutting is added in annulus sequence, if it is not, then abandoning this time cutting the data obtained.
Optionally, the transmission that morphologic description parameter and adjacent interlayer in layer are calculated according to the skeletonizing data
Parameter of regularity, specifically includes:
According to morphologic description parameter in the skeletonizing data computation layer, morphologic description parameter includes branch in layer in the layer
Radius, the limb in specified location with the intersection point of the limb and father's limb of the limb as the center of circle are done relative to described
The corner of father's limb of limb and drift angle, the limb are the limb grown from father's limb;
Determine the Transfer Parameters between adjacent two layers, the Transfer Parameters include sub- limb relative to father's limb drift angle,
The ratio of the ratio of the sub- limb radius and father's limb radius, the sub- limb length and father's limb length.
Optionally, the limb in the selection component set generates the trees in the scale Forest Scene, specifically includes:
The limb of the layer corresponding with required level is randomly selected in the component set;
The limb combination that will be extracted, the trees that the multiple forms of generation differ.
A kind of differential mode scale Forest Scene constructing system of the same race, the system includes:
Collecting unit, the 3D models for gathering single tree wood;
Model skeletonizing unit, by the model skeletonizing, the skeleton of the model is obtained for using annulus patterning method
Change data, in the skeletonizing data, each limb is represented with annulus sequence of the multiple with radius and direction;
Delaminating units, for being layered to the model;
Parameter calculation unit, for being calculated morphologic description parameter and adjacent interlayer in layer according to the skeletonizing data
Delivery rules parameter;
Layer intrinsic parameter feature calculation unit, for calculating the Gaussian Profile value of morphologic description parameter and side in each layer
Difference;
Interlayer parameter attribute computing unit, the Gaussian Profile value of the delivery rules parameter for calculating each adjacent interlayer
And variance;
Random perturbation unit, for the delivery rules parameter according to morphologic description parameter in the layer and the adjacent interlayer
Gaussian Profile value and variance the delivery rules parameter of morphologic description parameter in the layer and the adjacent interlayer is carried out at random
Disturbance, the parameter value after being disturbed;
Trunk generation unit, the trunk for generating different attitudes according to the parameter value after the disturbance, the different appearances
The trunk of state constitutes the component set of the model;
Trees generation unit, for selecting the trees in scale Forest Scene described in the limb combination producing in the component set.
Optionally, the model skeletonizing unit is specifically included:
Model cutting subelement, for the plane using different directions to the tri patch of the model specified location and with
The adjacent dough sheet of the tri patch is cut;
Broken line obtains subelement, for will once cut in broken line on the tri patch that obtains be connected, sealed
The broken line loop closed;
Circular judgment sub-unit, for judging whether the broken line loop with circular similarity reaches preset value, if
It is then this time to cut effectively, the annulus obtained by this cutting is added in annulus sequence, if it is not, then discarding is this time cut
Cut the data obtained.
Optionally, the parameter calculation unit is specifically included:
Layer intrinsic parameter computation subunit, for according to morphologic description parameter, the layer in the skeletonizing data computation layer
Interior morphologic description parameter includes in layer limb in specified location with the intersection point of the limb and father's limb of the limb as the center of circle
The corner of radius, the limb relative to father's limb of the limb and drift angle, the limb is raw from father's limb
The limb for growing;
Interlayer parameter computation unit, for determining the Transfer Parameters between adjacent two layers, the Transfer Parameters include son
Limb relative to the drift angle of father's limb, the ratio of the sub- limb radius and father's limb radius, the sub- limb length with it is described
The ratio of father's limb length.
Optionally, the trees generation unit is specifically included:
Limb chooses subelement, the limb for randomly selecting the layer corresponding with required level in the component set;
Trees generate subelement, for the limb combination that will be extracted, the trees that the multiple forms of generation differ.
Compared with prior art, the invention has the advantages that:
1) using the feature of tree limb form convergence annulus, it is proposed that the skeletonization method of annulus cutting, can be complete
Model skeletonizing is automatically carried out, so as to carry out the modeling of extensive scale Forest Scene with realizing full automation, it is not necessary to model
Personnel carry out any edit operation, solve the problems, such as current main-stream Method Modeling high cost.
2) using the multiplexing of limb, the trees of differential mode of the same race can be greatly enhanced gently by sharing in large scale scene
Quantization degree and rendering efficiency, it is ensured that model storage, the high efficiency transmitted and render, the data volume of the large scale scene of generation are remote
Less than conventional method, and very can glibly render large-scale scale Forest Scene.
3) parameter in layer and in interlayer rule is all relative value so that the son that diverse location grows on same limb
Branch possesses different morphological features, improves the generality of component set.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to institute in embodiment
The accompanying drawing for needing to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the invention
Example, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these accompanying drawings
Obtain other accompanying drawings.
Fig. 1 is the schematic flow sheet of embodiment of the present invention differential mode scale Forest Scene construction method of the same race;
Fig. 2 is the result schematic diagram of embodiment of the present invention annulus cutting;
Fig. 3 is the component set generation result schematic diagram of a certain layer of the embodiment of the present invention;
Fig. 4 is the structural representation of embodiment of the present invention differential mode scale Forest Scene constructing system of the same race.
Specific embodiment
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 clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
It is an object of the invention to provide a kind of differential mode scale Forest Scene construction method of the same race and system, can be to extensive forest
Automation rapid modeling is carried out, without artificial editor, and the storage pressure of rendering stage can be reduced, be greatly enhanced light weight
Change degree and rendering efficiency.
It is below in conjunction with the accompanying drawings and specific real to enable the above objects, features and advantages of the present invention more obvious understandable
The present invention is further detailed explanation to apply mode.
Fig. 1 is the schematic flow sheet of embodiment of the present invention differential mode scale Forest Scene construction method of the same race, as shown in figure 1, of the same race
Differential mode scale Forest Scene construction method step is as follows:
Step 101:The 3D models of collection single tree wood, 3D models can come from the ways such as Computer Database, fine arts modeling
Footpath;
Step 102:Using annulus patterning method by the model skeletonizing, the skeletonizing data of the model are obtained, in institute
State in skeletonizing data, each limb is represented with annulus sequence of the multiple with radius and direction, is cut by annulus patterning method
Tree modelling after cutting is as shown in Fig. 2 Fig. 2 is embodiment of the present invention annulus cutting result schematic diagram;
Specially:Using different directions plane to the tri patch of the model specified location and with the tri patch
Adjacent dough sheet is cut;
The broken line on tri patch obtained in once cutting is connected, the broken line loop closed;
Judge whether the broken line loop reaches preset value with circular similarity, if it is, this time cut effectively, will
Annulus obtained by this time cutting is added in annulus sequence, if it is not, then abandoning this time cutting the data obtained.
Step 103:The model is layered, layering herein is specially trunk labeled as ground floor, from trunk
On the limb that is directly separated out be marked as the second layer, the limb for being directly separated out from second layer limb is labeled as the 3rd
Layer, the limb for being directly separated out from third layer limb is labeled as the 4th layer, the like, will be all on whole 3D models
Limb whole layered shaping;
Step 104:The transmission rule of morphologic description parameter and adjacent interlayer in layer are calculated according to the skeletonizing data
Then parameter;
Morphologic description parameter includes that limb is in specified location in layer in the layer, with father's branch of the limb and the limb
Dry intersection point for the center of circle the corner of radius, the limb relative to father's limb of the limb and drift angle, the limb be from
The limb grown on father's limb;
The Transfer Parameters include sub- limb relative to the drift angle of father's limb, the sub- limb radius and father's limb radius
The ratio of ratio, the sub- limb length and father's limb length.
Step 105:Calculate the Gaussian Profile value and variance of morphologic description parameter in each layer;
Step 106:Calculate the Gaussian Profile value and variance of the delivery rules parameter of each adjacent interlayer;
Step 107:Gauss point according to morphologic description parameter in the layer and the delivery rules parameter of the adjacent interlayer
Implantation and variance carry out random perturbation to the delivery rules parameter of morphologic description parameter in the layer and the adjacent interlayer, obtain
Parameter value after disturbance;
Step 108:The trunk of different attitudes, the trunk structure of the different attitudes are generated according to the parameter value after the disturbance
Into the component set of the model;For example positioned at the limb A of the second layer, after random perturbation is carried out to its parameter, can obtain many
The parameter of kind of description limb, that is, obtained various attitudes for developing out by A limbs different limb B, C, D etc..
Step 109:Select the tree modelling in scale Forest Scene described in the limb combination producing in the component set.Described
The limb of the layer corresponding with required level is randomly selected in component set, the limb combination that will be extracted, the multiple forms of generation differ
Tree modelling.
Used as a kind of extremely complex 3D models, correctly to extract its skeleton generally needs to set many parameters trees, and
And need to carry out small parameter perturbations for each tree wood, lack automation means.The application limits to for this, it is proposed that based on tree
The skeletonization algorithm of wooden morphological feature:Tree modelling skeletonization algorithm based on annulus cutting.The method has caught trees shape
The feature of state, i.e. tree limb can be with the splicings of multiple round platforms come close approximation.Further, this feature is converted into trees
Limb can be represented with the limited sequence of annulus.Because tree modelling is typically to model gained by tringle coal, this
The plane of invention different directions removes the dough sheet for cutting the tri patch of tree modelling specified location and being bordered by with it, will once cut
Cut the broken line obtained on tri patch and couple together the broken line loop that will can obtain a closing.Due to tree limb
Cross section geometrically rounded, therefore the only loop shape it is approximate circle when, be just regarded as once effectively cutting simultaneously
In adding it to annulus sequence.Here it is to cut out with ensureing maximum likelihood effectively using the plane of different directions
Annulus.Last the method represented the limb of each trees with the annulus sequence with radius and directional information, the expression
The skeletonizing of as tree modelling is represented.Fig. 2 is the result schematic diagram of embodiment of the present invention annulus cutting, trees as shown in Figure 2
For the trees skeleton that input tree modelling is obtained after annulus cuts.
In the skeleton data of trees, each limb is this expression data volume using annulus sequence as representation
It is larger and be difficult to parameterize, the generation of extensive trees should not be directly used in.
The present invention is after trees skeleton is obtained, it is proposed that the stratification Rule Expression based on trees morphological feature, the expression
The form rule of trees is described by the way of layering.In this kind expression, if tree structure is divided into dried layer, in each layer
Portion possesses in the layer of oneself morphologic description rule, and this is mainly by counting in destination layer all limbs in each sampled equidistant
Corner and partially of the line of the ratio between annular radii and initial annular radii, the center of circle and father's branch intersection point relative to father's branch direction at position
Angle.Initial annulus refers to the corresponding sampling annulus in first sampling location, and calculate the distribution of these parametric Gaussians average and
Variance;Meanwhile, the delivery rules of geometric parameter are also needed between two-layer, this is mainly by counting sublayer limb relative to father's branch
Drift angle and length ratio and the parameter such as radius ratio with father's branch, obtain the average and variance of these parametric Gaussians distribution.It is worth
It is noted that in method for expressing of the invention, the parameter in layer and in interlayer rule is all based on coming with a distance from branch point
Sampled.Advantage of this is that so that the sub- branch that diverse location grows on same limb possesses different forms spies
Levy.
The present invention is after trees stratification rule is got and be not directly based on the rule to generate independent tree modelling individual
Body, and be attempt to allow the trees in large scale scene to share a public limb collection, can so be significantly reduced when rendering
The data volume of contextual data storage.The method be based on stratification rule-statistical its parameters (mainly in layer in rule half
Length ratio, radius ratio and drift angle in footpath, corner and drift angle, and interlayer rule) Gaussian Profile average and variance, and by layer
It is secondary to carry out random perturbation, i.e., the Gaussian Profile obeyed based on each parameter, carrying out randomization to obtain under the distribution one is
Row random value.Being then based on disturbing the parameter for obtaining carries out dough sheet generation, so as to obtain the component set of stratification, as shown in figure 3,
Fig. 3 is the component set generation result schematic diagram of a certain layer of the embodiment of the present invention.In the method, a pair of the rule one of each level
Should level component set, each component set is made up of the branch of several levels.After component set is obtained, in component set
Every branch will exist as the component for being shared reference, even if cited in many trees, also only needing to storage a
Dough sheet data, greatly reduce the storage pressure of rendering stage.
, it is necessary to by each trees in large scale scene all with group after the stratification component set of random spanning tree wood
The branch that part is concentrated usually is indicated for shared unit, determines where each tree wood is placing which branch becomes light weight
Change the key of representation correctness.The generating mode of trees not only relies on the component set of generation in the application method, meanwhile, it
Directly rely on the trees stratification rule that preceding step gets.In fact, system of the stratification rule as trees morphological feature
Count, have for trees morphological feature and comprehensively portray.Random perturbation is directly carried out to it can obtain any in scene
The morphological feature (such as bifurcation position, sub- branch number etc.) that one tree wood should have, then obtains optimal from component set again
Matching component.On the one hand the method belongs to the category of rule-based generation, therefore it may ensure that the trees for ultimately generating all are
The individuality of differential mode of the same race;On the other hand, each tree wood is not independent occupancy dough sheet collection in scene, and they share component set, because
This greatly reduces internal memory and video memory expense in rendering stage.Simultaneously as many trees share the dough sheet collection of same component, this
Also with the instantiation render method that graphic hardware is supported be combined for it by problem, carries out instantiation render to each component, significantly
The efficiency that raising is rendered.
The differential mode scale Forest Scene construction method of the same race that the present invention is provided is based on the tree modelling skeletonizing of annulus cutting, improves
The precision and robustness of tree modelling skeletonizing;Represented using the hierarchical rule of trees, compared with the regular energy of form of production
Enough growth tendencies for more accurately expressing tree limb;The representation of the shared component set of tree limb is proposed, by what is shared
Mode significantly reduces the data volume of large scale scene, and instantiation render with reference to graphic hardware drastically increases scene
Rendering efficiency.
To reach above-mentioned purpose, present invention also offers a kind of differential mode scale Forest Scene constructing system of the same race, as shown in figure 4,
The system includes:
Collecting unit 401, the 3D models for gathering single tree wood;
Model skeletonizing unit 402, by the model skeletonizing, the bone of the model is obtained for using annulus patterning method
Frame data, in the skeletonizing data, each limb is represented with annulus sequence of the multiple with radius and direction;
Delaminating units 403, for being layered to the model;
Parameter calculation unit 404, for being calculated in layer morphologic description parameter and adjacent according to the skeletonizing data
The delivery rules parameter of interlayer;
Layer intrinsic parameter feature calculation unit 405, Gaussian Profile value and side for calculating morphologic description parameter in the layer
Difference;
Interlayer parameter attribute computing unit 406, the Gaussian Profile of the delivery rules parameter for calculating the adjacent interlayer
Value and variance;
Random perturbation unit 407, for the delivery rules according to morphologic description parameter in the layer and the adjacent interlayer
The Gaussian Profile value and variance of parameter are carried out to the delivery rules parameter of morphologic description parameter in the layer and the adjacent interlayer
Random perturbation, the parameter value after being disturbed;
Trunk generation unit 408, the trunk for generating different attitudes according to the parameter value after the disturbance, the difference
The trunk of attitude constitutes the component set of the model;
Trees generation unit 409, for selecting the tree in scale Forest Scene described in the limb combination producing in the component set
Wood.
Wherein, model skeletonizing unit 402 is specifically included:Model cutting subelement, for the plane using different directions
Tri patch and the dough sheet adjacent with the tri patch to the model specified location cut;It is single that broken line obtains son
Unit, for will once cut in broken line on the tri patch that obtains be connected, the broken line loop closed;Circle judges
Subelement, for judging whether the broken line loop with circular similarity reaches preset value, if it is, being this time cut with
Effect, the annulus obtained by this cutting is added in annulus sequence, if it is not, then abandoning this time cutting the data obtained.
Parameter calculation unit 404 is specifically included:Layer intrinsic parameter computation subunit, for being calculated according to the skeletonizing data
Morphologic description parameter in layer, morphologic description parameter includes in layer limb in specified location in the layer, with the limb with it is described
Radius, limb corner relative to the father limb of the limb and drift angle of the intersection point of father's limb of limb for the center of circle, institute
It is the limb grown from father's limb to state limb;Interlayer parameter computation unit, for determining between adjacent two layers
Transfer Parameters, the Transfer Parameters include sub- limb relative to the drift angle of father's limb, the sub- limb radius and father's limb radius
Ratio, the ratio of the sub- limb length and father's limb length.
Trees generation unit 409 is specifically included:Limb chooses subelement, for being randomly selected in the component set and institute
Need the limb of the corresponding layer of level;Trees generate subelement, and for the limb combination that will be extracted, the multiple forms of generation differ
Trees.
The differential mode scale Forest Scene constructing system of the same race that the present invention is provided is based on the tree modelling skeletonizing of annulus cutting, improves
The precision and robustness of tree modelling skeletonizing;Represented using the hierarchical rule of trees, compared with the regular energy of form of production
Enough growth tendencies for more accurately expressing tree limb;The representation of the shared component set of tree limb is proposed, by what is shared
Mode significantly reduces the data volume of large scale scene, and instantiation render with reference to graphic hardware drastically increases scene
Rendering efficiency.
Each embodiment is described by the way of progressive in this specification, and what each embodiment was stressed is and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For system disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
Specific case used herein is set forth to principle of the invention and implementation method, and above example is said
It is bright to be only intended to help and understand the method for the present invention and its core concept;Simultaneously for those of ordinary skill in the art, foundation
Thought of the invention, will change in specific embodiments and applications.In sum, this specification content is not
It is interpreted as limitation of the present invention.