CN100578547C - Method and system for simulating river - Google Patents

Method and system for simulating river Download PDF

Info

Publication number
CN100578547C
CN100578547C CN200710099168A CN200710099168A CN100578547C CN 100578547 C CN100578547 C CN 100578547C CN 200710099168 A CN200710099168 A CN 200710099168A CN 200710099168 A CN200710099168 A CN 200710099168A CN 100578547 C CN100578547 C CN 100578547C
Authority
CN
China
Prior art keywords
curve
segment
vector
anglec
rotation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN200710099168A
Other languages
Chinese (zh)
Other versions
CN101051390A (en
Inventor
刘思维
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Software Co Ltd
Beijing Jinshan Digital Entertainment Technology Co Ltd
Original Assignee
Beijing Kingsoft Software Co Ltd
Beijing Jinshan Digital Entertainment Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Software Co Ltd, Beijing Jinshan Digital Entertainment Technology Co Ltd filed Critical Beijing Kingsoft Software Co Ltd
Priority to CN200710099168A priority Critical patent/CN100578547C/en
Publication of CN101051390A publication Critical patent/CN101051390A/en
Application granted granted Critical
Publication of CN100578547C publication Critical patent/CN100578547C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention provides a river simulation method and system. Said method includes the following steps: drawing curve chain correspondent to the river to be simulated, and directing against tail width and tail rotation angle of every curve segment in said curve chain; utilizing the described drawing process to define control information of every curve segment; according to the parameter of every curve segment in said curve chain defining every top point coordinate of said simulated river; the described parameter includes control information of curve segment, tail width and rotation angle of curve segment; connecting top point coordinates to obtain a strip band network formed from several triangles; adopting presetting rule, setting correspondent texture coordinate for every top point; utilizing top point coordinates and texture coordinate to make application of colors so as to obtain river.

Description

A kind of method and system that is used for simulating river
Technical field
The present invention relates to 3D graphics plotting field, particularly relate to a kind of method and system that is used for simulating river.
Background technology
Along with the continuous evolution of computer graphic technology, the popularizing of the enhancing of 3D drawing hardware usefulness and broadband network, the 3D The Application of Technology has also had new style and features.The use of 3D technology is very extensive at present, the theme that it has become all circles' research, has used, although the 3D application development also just becomes the most popular research topic of trend of the times, also be the direction that every profession and trade is made great efforts, its development topic stride and designing for manufacturing, ecommerce, cartoon making, multimedia teaching, virtual reality and recreation industry etc.
It is the very big thing of job amount that but application 3D technology is carried out the very high simulation of validity to the object in the scene, for example, simulation to the river in the prior art just needs following steps: the model of being made the river earlier by the fine arts at modeling tools such as 3D Max or Maya, by the derivation instrument these models are exported to the data file of render engine specific format then, in the scene editing machine, this data file imported at last and will be placed on corresponding position in the scene.And in the process that scene is made, when causing the model in river to adjust if the relevant scene in river has carried out adjusting, so above-mentioned process just need re-execute once, wastes system resources in computation.Said method is complicated and cumbersome, can not carry out the editor who carries out the river of What You See Is What You Get.
Therefore, press for those skilled in the art and invent out a kind of simple simulating river method.
Summary of the invention
Technical matters to be solved by this invention provides a kind of simulating river method and system, can make things convenient for and simplify the simulation process in river.
In order to address the above problem, embodiments of the invention disclose a kind of simulating river method, may further comprise the steps: draw and the corresponding curve chain in river of being simulated, and determine each segment of curve corresponding end width and the end anglec of rotation in this curve chain; Determine the control information of each segment of curve by described drawing process; According to the parameter of each segment of curve in this curve chain, determine each apex coordinate in the river of simulating, described parameter comprises the control information of segment of curve, the end width and the anglec of rotation of segment of curve; Connect apex coordinate, obtain the strip band network of forming by a plurality of triangles; Adopt presetting rule, corresponding texture coordinate is set at each summit; Play up according to apex coordinate and texture coordinate, obtain the river.
Preferably, described method can also comprise: increase by a time dependent variable in described texture coordinate, to realize dynamic texture.
Further, the parameter of first segment of curve in the described curve chain also comprises: the initial width and the initial anglec of rotation.
Preferably, when described curve chain is the vector chain, determine corresponding apex coordinate at a vector: this vector is divided into predetermined hop count by following steps; By the length and the direction of this vector, obtain the length and the direction of each section; Obtain the width of each section by initial width of this vector and end width linearity interpolation; Obtaining each section by the initial anglec of rotation of this vector and end anglec of rotation linear interpolation is center, the anglec of rotation that centers on this vector with this vector; According to length, direction, width and the anglec of rotation of each section, determine that in these vector both sides the summit distributes.
Preferably, when described curve chain is the Bezier chain, determine corresponding apex coordinate by following steps at a Bezier section: this segment of curve is divided into predetermined hop count; By the parametric equation of this segment of curve, obtain the location point U of each segment, and normal plane; The anglec of rotation that obtains each segment location point U by the initial anglec of rotation and the end anglec of rotation linear interpolation of this segment of curve; The normal of determining each segment location point U according to the anglec of rotation and the normal plane of each segment; The width that obtains each segment location point U by the initial width and the end width linearity interpolation of this segment of curve; According to width and the normal of each segment location point U, determine that the summit distributes.
Preferably, the plot step of described curve chain is finished in the scene editing machine.
According to embodiments of the invention, a kind of simulating river system is also disclosed, comprising:
Curve chain drawing unit, the corresponding curve chain in river that is used to draw Yu is simulated, and determine each segment of curve corresponding end width and the end anglec of rotation in this curve chain; Determine the control information of each segment of curve by described drawing process;
The summit determining unit is used for the parameter according to this each segment of curve of curve chain, determines each apex coordinate in the river of simulating, and described parameter comprises the control information of segment of curve, the end width and the anglec of rotation of segment of curve;
The strip band network generation unit is used to connect each apex coordinate, obtains the strip band network of being made up of a plurality of triangles;
The texture coordinate determining unit is used to adopt presetting rule, at each summit corresponding texture coordinate is set;
Rendering unit is used for playing up according to apex coordinate and texture coordinate, obtains the river.
Preferably, also comprise a time dependent variable in the described texture coordinate, to realize dynamic texture.
Preferably, the parameter of first segment of curve in the described curve chain also comprises: the initial width and the initial anglec of rotation.
Preferably, when described curve chain was the vector chain, described summit determining unit further comprised: the subelement that is used for this vector is divided into predetermined hop count; Be used for length and direction, obtain the subelement of the length and the direction of each section by this vector; Be used for obtaining the subelement of the width of each section by initial width of this vector and end width linearity interpolation; Being used for obtaining each section by the initial anglec of rotation of this vector and end anglec of rotation linear interpolation is center, the subelement that centers on the anglec of rotation of this vector with this vector; Be used for length, direction, width and the anglec of rotation, determine the subelement that the summit distributes in these vector both sides according to each section.
Preferably, when described curve chain was the Bezier chain, described summit determining unit further comprised: the subelement that is used for this segment of curve is divided into predetermined hop count; Be used for parametric equation, obtain the location point U of each segment by this segment of curve, and the subelement of normal plane; Be used for the subelement that the initial anglec of rotation and end anglec of rotation linear interpolation by this segment of curve obtain the anglec of rotation of each segment location point U; Be used for the subelement of determining the normal of each segment location point U according to the anglec of rotation and the normal plane of each segment; Be used for the subelement that initial width and end width linearity interpolation by this segment of curve obtain the width of each segment location point U; Be used for width and normal, determine the subelement that the summit distributes according to each segment location point U.
Compared with prior art, the present invention has the following advantages:
The present invention is by adopting special data structure to the river, generate the model in river by Automatic Program, and texture coordinate, can What You See Is What You Get in the scene editing machine carry out the river editor, greatly facilitate and simplify simulation to the river.
Description of drawings
Fig. 1 is the flow chart of steps of a kind of simulating river method of the present invention embodiment;
Fig. 2 is the flow chart of steps of another simulating river method of the present invention (realizing with the vector chain) embodiment;
Fig. 3 is the synoptic diagram of vector chain;
Fig. 4 is the synoptic diagram by the strip band network of vector chain generation;
Fig. 5 is the texture coordinate synoptic diagram that is generated;
Fig. 6 is the flow chart of steps of the method embodiment of a kind of definite apex coordinate (realizing with the vector chain);
Fig. 7 is the synoptic diagram of certain vector in the another kind of strip band network;
Fig. 8 is another flow chart of steps of determining the method embodiment of apex coordinate (realizing with the Fan Saier curve);
Fig. 9 is a synoptic diagram of drawing the Fan Saier segment of curve;
Figure 10 is the synoptic diagram that connects two Fan Saier segment of curve;
Figure 11 is a synoptic diagram of determining apex coordinate when realizing with the Fan Saier curve;
Figure 12 is the synoptic diagram that concerns between normal plane, normal and the anglec of rotation;
Figure 13 is the synoptic diagram that concerns between normal plane, normal, the anglec of rotation, width and the apex coordinate;
Figure 14 is a kind of structured flowchart of system embodiment of simulating river;
Figure 15 is the structured flowchart of the system embodiment of another simulating river.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Core concept of the present invention is: the present invention is connected together the simulation of carrying out the river with a plurality of bands that have direction.Each band is described by the rotation along the vector center of the width at a segment of curve, segment of curve end and segment of curve end, band joins end to end and forms the curve chain of a bandwidth and spin data so one by one, bring according to the width at the locality of each segment of curve, length, end and triangle of rotational automatic generation then and form the river vertex data, in these vertex datas, give one along the continuous texture coordinate of curve chain direction, use the texture in river at last.During operation, the texture coordinate on summit is carried out smoothly moving the flow effect in simulation river along the curve chain.
With reference to Fig. 1, show a kind of method of simulating river, be mainly used in the 3D scene river is simulated and played up, specifically can comprise:
Step 101, the corresponding curve chain in river of drawing and being simulated, and at each segment of curve corresponding end width and the end anglec of rotation in this curve chain; Determine the control information of each segment of curve by described drawing process;
Step 102, according to the parameter of each segment of curve in this curve chain, determine each apex coordinate in the river of simulating, described parameter comprises the control information of segment of curve, the end width and the anglec of rotation of segment of curve;
Step 103, connection apex coordinate obtain the strip band network of being made up of a plurality of triangles;
Step 104, employing presetting rule are provided with corresponding texture coordinate at each summit;
Step 105, play up, obtain the river according to apex coordinate and texture coordinate.
Curve chain described in the step 101 can be vector chain, Bezier or B-spline curves or the like, and the present invention does not need the pattern of curve is limited at this, as long as can evenly determine corresponding apex coordinate in the curve both sides.
The control information of segment of curve described in the step 101 is mainly used in determines this segment of curve, and for example, for the vector chain, then control information comprises the position and the directional information of this vector; For Bezier, then control information comprises the information at starting point, terminal point and the reference mark of this segment of curve.
Draw the mode (similar picture) that directly to draw by the art designing personnel described in the step 101, also can adopt setup parameter to generate the mode of drawing result then.
With reference to Fig. 2, show a kind of method embodiment of simulating river, this embodiment has adopted the mode of vector chain to realize, specifically can may further comprise the steps:
Step 201, draw the vector chain, and the corresponding end width and the end anglec of rotation are set at each vector in this vector chain.
The vector chain is as the term suggests be exactly to be joined end to end by a plurality of vectors to form chain form.The vector chain by the technician (for example, the fine arts) in scene, pass through to click, the direction and the length of each bar vector is specified in the position of definite point, just as drawing polygonal in Word, after clicking certain position, just have a line and connect mouse and determined just now position all the time, click another position then and determine article one vector, the direction of vector is exactly the direction from first o'clock to second point, and length is exactly the distance between 2.So, the 3rd point is used for determining the second vector.
After having determined the position of vector chain, can also adjust the starting point and the terminal point of each vector, and set the width and the anglec of rotation at each vector end,, also need the width and the anglec of rotation of its starting point are provided with for first vector.
With reference to Fig. 3, wherein, square arrow 301 is a starting point, and the arrow 302,303 of band line respectively is a vector, and the width of arrow 302,303 is the width at end, and the rotation of arrow 302,303 is the rotation at end.Fine arts personnel can see the vector chain that is formed by a plurality of arrows links when adjusting the vector chain, see the terminal of each vector intuitively, width, the rotation of end point, and width and rotation during the vector start of chain.
The plot step 201 of described vector chain is finished in the scene editing machine and is got final product, be that the technician completes after the vector chain, finish the data handling procedure of subsequent step by Automatic Program, thereby can be implemented in the edit mode of the What You See Is What You Get in the scene editing machine, greatly facilitate and simplify simulation process the river.When river that scene take place to be adjusted or simulated was improper, the technician only need adjust this vector chain in the scene editing machine correlation parameter got final product.
Step 202, according to the parameter of this vector chain, determine each apex coordinate in the river of simulating, described vector chain parameter comprises vector length, direction vector, vector end width and the anglec of rotation.
Step 203, connection apex coordinate obtain the strip band network of being made up of a plurality of triangles.
Referring to Fig. 4, the synoptic diagram of the strip band network of forming by a plurality of triangles that generates by the vector chain.Wherein, the triangle number that each bar vector generates can be adjusted by fine arts specified number of segments, and leg-of-mutton number is the twice of hop count, because a section is put together by two triangles.Therefore four summits of one section correspondence among Fig. 4, can get final product according to the both sides that hop count is distributed in the summit vector uniformly, wherein, and latter two summit of the last period and back one section preceding two summit occasions.
Step 204, employing presetting rule are provided with corresponding texture coordinate at each summit.
Texture generally is meant the 2D pinup picture (bitmap) in the 3D figure, can be applied on the triangle (or triangle of some), is used for increasing the sense of reality.The effect of texture coordinate is to specify a point on texture, because texture is 2D, so we only need two value: U and V.U is the value of transverse axis, and V is the value of the longitudinal axis, and the value of U and V should (be got other value and be used to generate special efficacy) between 0 and 1, and the upper left corner is that (0,0) lower right corner is (1,1).Wherein, for certain position on the texture (X1, Y1), (U1, V1)=(X1/ texture width, Y1/ texture height), therefore: U=1, i.e. X=texture width, V=1, i.e. Y=texture height.When UV less than 0 the time, or can be mapped to XY according to specified address pattern greater than 1 o'clock texture, as: adopt the Wrap address pattern, the mapping that then circulates (as tiling, this address pattern of employing among the present invention); And adopt the Mirror address pattern, then carry out the mirror image mapping.
For the present invention, can adopt variety of way to determine texture coordinate, for example,,, specify texture coordinate just passable for successively each summit of each segment according to the direction of vector with reference to Fig. 5.Such as, the texture coordinate on first and second segment summit is: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1).It is just passable promptly only need to be set to n for the U coordinate of n segment, and the V coordinate promptly is respectively 0 and 1.Certainly, carry out the effect that some convergent-divergents reach the whole river of convergent-divergent texture at two coordinates of U, V also can for texture coordinate.For example, the texture coordinate that first and second segment summit is set is: (0,0), (0,1), (0.5,0), (0.5,1), (1,0), (1,1); Perhaps, (0,0), (0,1), (2,0), (2,1), (4,0), (4,1) or the like.
The mode of other definite texture coordinates well known to those skilled in the art also all is feasible, for example, calculates corresponding texture coordinate or the like according to apex coordinate according to certain rule.
Further, texture coordinate can corresponding a plurality of textures, if used a plurality of textures for certain object, then simultaneously also need to specify in these textures and how to mix, though implement trouble, under some scene, can obtain more real visual experience.Because this part technology belongs to well-known to those skilled in the art, therefore, repeats no more.
Step 205, play up, obtain the river according to apex coordinate and texture coordinate.
The technology of playing up is the hot spot technology in the recreation programming world, and it also has important effect in other field simultaneously.As generalized information system, the flight simulation system, VR system and digital earth technology etc. all be unable to do without the real-time rendering technology of outdoor scene.An outstanding outdoor scene real-time rendering technology is guaranteeing can also to create very true to nature, convictive virtual physical environment beyond the real-time.Playing up of 3D scene be unable to do without 3D API.Popular 3D API has two kinds, the OpenGL of SGI company and the Direct3D of Microsoft at present.
Owing to, obtained apex coordinate and corresponding texture coordinate by abovementioned steps, use the texture in a river again, just can render the river; For example, only need import above-mentioned data into video card by the API that calls D3D just can realize having played up.But river at this moment can not move, because the not operation of the coordinate of texture.Need change the texture coordinate on summit as parameter according to the time in the simulation in river, to produce mobile visual effect.Be (1,0) such as: summit 1 at T1 texture coordinate constantly, be (2,0) at T2 texture coordinate constantly, is (n, 0) at Tn texture coordinate constantly, at this moment with regard to the mobile effect on the summit of texture as can be seen.Promptly just can allow the river flow as long as on the U of all vertex textures coordinate, all add a time dependent amount.
The foregoing description is that the mode that adopts the static images circulation to show realizes dynamic texture, certainly, those skilled in the art also can adopt other feasible implementations, for example, the Chinese publication number of Kingsoft Co. application is to propose in the patent publication us of CN1936964A: utilize video file to realize the method for the cartoon grain in the 3D scene.
With reference to Fig. 6, show and a kind ofly determine specifically to may further comprise the steps the method embodiment of corresponding apex coordinate at a vector:
Step 601, this vector is divided into predetermined hop count; Described predetermined hop count can be waited to specify according to actual needs and get final product by fine arts personnel, perhaps also can set the corresponding tables of hop count-demand, and therefrom inquiry obtains automatically.
Step 602, by the length and the direction of this vector, obtain the length and the direction of each section;
Step 603, obtain the width of each section by initial width of this vector and end width linearity interpolation;
Step 604, by the initial anglec of rotation of this vector and end anglec of rotation linear interpolation obtain each section with this vector be the center, around the anglec of rotation of this vector;
Step 605, the length according to each section, direction, width and the anglec of rotation determine that in these vector both sides the summit distributes.
Need to prove, unfixing ordinal relation between the above step, some step can also be combined into a step and finish, for example, step 601 and 602 etc.In addition, the linear interpolation computing method that obtain each section respective width and the anglec of rotation only are preferred versions of present embodiment, those skilled in the art can certainly use the respective width and the anglec of rotation that other any feasible calculated with mathematical model obtain each section according to actual needs, as long as obtain these data, just can obtain the comprehensive architecture in river by this vector chain; Only the quality of these parameters can have influence on the shape in the river of simulating.
Because all objects all are made up of the simplest triangle in the computer graphics, preferred so in the present embodiment, connect the resulting strip band network of apex coordinate and constitute by a plurality of triangles.The triangle number that each bar vector generates can be decided by the hop count of being scheduled to, and leg-of-mutton number is the twice of hop count, because a section is put together by two triangles.Program is distributed in the summit both sides of vector uniformly according to hop count then, has determined leg-of-mutton X-Y scheme by length, width and the direction of each section, according to the anglec of rotation a plurality of triangles is coupled together again, thereby forms three-dimensional structure.
The width linearity interpolation at the width of each section width when initial and end by vector produces, and each section all is the center with the vector, and also the anglec of rotation linear interpolation the during anglec of rotation one end when initial produces by vector around the angle of vector rotation.For linear interpolation, promptly can be interpreted as: to playing, end two numbers are obtained mediant according to parameter method.Concrete formula can be written as: P=P1+t (P2-P1), P1 are initial value, and P2 is a stop value, and t is parameter (0≤t≤1), P=P1 when t=0, P=P2 when t=1.As: 7 temperature is 15 degree, and ten two temperature is 25 degree, and according to linear interpolation, 10 temperature is: 15+ (10-7)/(12-7) * (25-15)=21 degree.
In two places that vector is end to end, because first section width of the latter end of a last vector and next vector is all identical with rotation, so the first section summit that can adopt the latter end of a vector of next vector, be stitched together, finally form a continuous band.For the slick and sly problem of two vector junctions, can reach preferable effect by hop count that increases this vector or the modes such as hop count that increase adjacent a plurality of vectors.
Step 601-605 is only used for realizing a kind of scheme of strip band network shown in Figure 4, if the structure of required strip band network is complicated more, for example, referring to Fig. 7, one section of vector is made up of 4 or more triangle, then can increases at the set vertex data of each section, the corresponding calculated step is complexity more also, such as, this section width is further divided or the like.
The embodiment that the front is described in detail adopts the vector chain to represent the position and the direction in river, generates the summit, finally produces into band.It is simple adopting the advantage of vector chain, but because the vector chain is by the end to end chain that forms of vector, therefore, each bar vector all is straight, want to form the bar number that slick and sly vector chain just has to increase vector, and shorten the length of every vector, bring bigger workload can for like this river producer.
A kind of improved plan is, adopt curve to replace the vector chain, as the position in river and the expression of direction, and curve generates the summit thus, though still will sample by segment to curve when generating the summit, because the number of segment is more, and the distance of segment is shorter, to compare will be a relatively slicker and more sly band to the band of Sheng Chenging like this, and be straight just like that by the unidirectional segment of the generation of the vector in the vector chain unlike before.
Be that example sets forth how to determine curve with three Beziers below, and how generate the summit.Wherein with the implementation of aforementioned vector chain in similarity just no longer describe in detail, get final product referring to aforementioned relevant portion.
With reference to Fig. 8, show and a kind ofly determine specifically to may further comprise the steps the method embodiment of corresponding apex coordinate at a Bezier section:
Step 801, this segment of curve is divided into predetermined hop count;
For Bezier, a Bezier is by a starting point, and a terminal point and two reference mark are determined.Referring to Fig. 9, P0, P3 are the terminal of curve, and P1, P2 are the reference mark.P0 is the tangent line of P0 to the vector of P1, and P3 is the tangent line of P3 to the vector of P2.
The parametric equation of Bezier is as follows:
Q(u)=P 0(1-u) 3+P 13u(1-u) 2+P 23u 2(1-u)+P 3u 3
Wherein, u is a parameter, (0≤u≤1).
Two Bezier sections are mutually in succession the time, need overlap the starting point of the terminal point of previous Bezier section and a back Bezier section, and the tangent line of the starting point of the tangent line of the terminal point of previous Bezier section and a back Bezier section should be on same straight line, to guarantee the continuity of two Bezier sections.With reference to Figure 10, the terminal point P3 of Q1 and the starting point S0 of Q2 overlap, and the tangent line of the tangent line of P3 and S0 is on same straight line.
Step 802, by the parametric equation of this segment of curve, obtain the location point U of each segment, and normal plane;
Suppose that we are divided into 10 sections with curve, then the parameters u of every segment is respectively 0.1,0.2, and 0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0.The parameter substitution parametric equation of each segment can be tried to achieve the location point U of each segment and normal plane; Concrete evaluation process belongs to the general knowledge of this field mathematical computations, has not described in detail at this.Referring to Figure 11, show parameters u and be respectively 0.2 and 0.7 o'clock normal plane F1, F2; Location point U1, U2; And final summit a, b, c, the d that determines.
Step 803, the anglec of rotation that obtains each segment location point U by the initial anglec of rotation and the end anglec of rotation linear interpolation of this segment of curve;
Step 804, the normal of determining each segment location point U according to the anglec of rotation and the normal plane of each segment;
With reference to Figure 12, show the relation between normal plane F1, normal L and the anglec of rotation β, location point is U1.
Step 805, the width that obtains each segment location point U by the initial width and the end width linearity interpolation of this segment of curve;
Step 806, according to width and the normal of each segment location point U, determine that the summit distributes.
With reference to Figure 13, show the result who determines summit b according to parameter shown in Figure 12, the distance between its mid point U1 and the some b equals the width of step 805 gained, and the relation between normal plane F1, normal L and the anglec of rotation β is also as shown in the figure.
Because concrete computation process is by the mathematical properties decision of Bezier, and for the implementation that adopts Bezier, its band generates step, texture coordinate generates and it is all similar to aforesaid embodiment to play up step, therefore, present embodiment only need simply be introduced unique distinction and gets final product.
With reference to Figure 14, show a kind of system embodiment that is used for simulating river, specifically can comprise:
Curve chain drawing unit 1401, the corresponding curve chain in river that is used to draw Yu is simulated, and at each segment of curve corresponding end width and the end anglec of rotation in this curve chain; Determine the control information of each segment of curve by described drawing process;
Summit determining unit 1402 is used for the parameter according to this each segment of curve of curve chain, determines each apex coordinate in the river of simulating, and described parameter comprises the control information of segment of curve, the end width and the anglec of rotation of segment of curve;
Strip band network generation unit 1403 is used to connect each apex coordinate, obtains the strip band network of being made up of a plurality of triangles;
Texture coordinate determining unit 1404 is used to adopt presetting rule, at each summit corresponding texture coordinate is set;
Rendering unit 1405 is used for playing up according to apex coordinate and texture coordinate, obtains the river.
Preferably, also comprise a time dependent variable in the described texture coordinate, to realize dynamic texture.The parameter of first segment of curve in the described curve chain also comprises, the initial width and the initial anglec of rotation.
For one of implementation of described summit determining unit, be example with the Bezier, it further can comprise: the subelement that is used for this segment of curve is divided into predetermined hop count; Be used for parametric equation, obtain the location point U of each segment by this segment of curve, and the subelement of normal plane; Be used for the subelement that the initial anglec of rotation and end anglec of rotation linear interpolation by this segment of curve obtain the anglec of rotation of each segment location point U; Be used for the subelement of determining the normal of each segment location point U according to the anglec of rotation and the normal plane of each segment; Be used for the subelement that initial width and end width linearity interpolation by this segment of curve obtain the width of each segment location point U; Be used for width and normal, determine the subelement that the summit distributes according to each segment location point U.
Referring to Figure 15, show a kind of system embodiment that is used for simulating river, specifically can comprise:
Vector chain drawing unit 1501 is used to draw the vector chain, and at each vector in this vector chain the corresponding end width and the end anglec of rotation is set;
Summit determining unit 1502 is used for the parameter according to this vector chain, determines each apex coordinate in the river of simulating, and described vector chain parameter comprises vector length, direction vector, vector end width and the anglec of rotation;
Strip band network generation unit 1503 is used to connect each apex coordinate, obtains the strip band network of being made up of a plurality of triangles;
Texture coordinate determining unit 1504 is used to adopt presetting rule, at each summit corresponding texture coordinate is set;
Rendering unit 1505 is used for playing up according to apex coordinate and texture coordinate, obtains the river.Rendering unit generally needs and figure API (for example, D3D, Opengl etc.) carries out data interaction, the playing up of deadline.
Preferably, also comprise a time dependent variable in the described texture coordinate, to realize dynamic texture.The parameter of first vector in the described vector chain also comprises, the initial width and the initial anglec of rotation.
For one of implementation of described summit determining unit, it further comprises: the subelement that is used for this vector is divided into predetermined hop count; Be used for length and direction, obtain the subelement of the length and the direction of each section by this vector; Be used for obtaining the subelement of the width of each section by initial width of this vector and end width linearity interpolation; Being used for obtaining each section by the initial anglec of rotation of this vector and end anglec of rotation linear interpolation is center, the subelement that centers on the anglec of rotation of this vector with this vector; Be used for length, direction, width and the anglec of rotation, determine the subelement that the summit distributes in these vector both sides according to each section.
Preferably, described vector chain drawing unit, summit determining unit, strip band network generation unit and texture coordinate determining unit are arranged in the scene editing machine, promptly by improving existing scene editing machine, increase function corresponding and realize the present invention.Certainly, also can direct organization a software independently, comprise each unit shown in Figure 7, also can realize the present invention.
For system embodiment, because it is substantially corresponding to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than to a kind of method and system that is used for simulating river provided by the present invention, be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (11)

1, a kind of simulating river method is characterized in that, comprising:
Draw and the corresponding curve chain in river of being simulated, and determine each segment of curve corresponding end width and the end anglec of rotation in this curve chain; Determine the control information of each segment of curve by described drawing process;
According to the parameter of each segment of curve in this curve chain, determine each apex coordinate in the river of simulating, described parameter comprises the control information of segment of curve, the end width and the anglec of rotation of segment of curve;
Connect apex coordinate, obtain the strip band network of forming by a plurality of triangles;
Adopt presetting rule, corresponding texture coordinate is set at each summit;
Play up according to apex coordinate and texture coordinate, obtain the river.
2, the method for claim 1 is characterized in that, also comprises:
In described texture coordinate, increase by a time dependent variable, to realize dynamic texture.
3, the method for claim 1 is characterized in that, the parameter of first segment of curve in the described curve chain also comprises: the initial width and the initial anglec of rotation.
4, the method for claim 1 is characterized in that, when described curve chain is the vector chain, determines corresponding apex coordinate by following steps at a vector:
This vector is divided into predetermined hop count;
By the length and the direction of this vector, obtain the length and the direction of each section;
Obtain the width of each section by initial width of this vector and end width linearity interpolation;
Obtaining each section by the initial anglec of rotation of this vector and end anglec of rotation linear interpolation is center, the anglec of rotation that centers on this vector with this vector;
According to length, direction, width and the anglec of rotation of each section, determine that in these vector both sides the summit distributes.
5, the method for claim 1 is characterized in that, when described curve chain is the Bezier chain, determines corresponding apex coordinate by following steps at a Bezier section:
This segment of curve is divided into predetermined hop count;
By the parametric equation of this segment of curve, obtain the location point U of each segment, and normal plane;
The anglec of rotation that obtains each segment location point U by the initial anglec of rotation and the end anglec of rotation linear interpolation of this segment of curve;
The normal of determining each segment location point U according to the anglec of rotation and the normal plane of each segment;
The width that obtains each segment location point U by the initial width and the end width linearity interpolation of this segment of curve;
According to width and the normal of each segment location point U, determine that the summit distributes.
6, the method for claim 1 is characterized in that, the plot step of described curve chain is finished in the scene editing machine.
7, a kind of simulating river system is characterized in that, comprising:
Curve chain drawing unit, the corresponding curve chain in river that is used to draw Yu is simulated, and determine each segment of curve corresponding end width and the end anglec of rotation in this curve chain; Determine the control information of each segment of curve by described drawing process;
The summit determining unit is used for the parameter according to this each segment of curve of curve chain, determines each apex coordinate in the river of simulating, and described parameter comprises the control information of segment of curve, the end width and the anglec of rotation of segment of curve;
The strip band network generation unit is used to connect each apex coordinate, obtains the strip band network of being made up of a plurality of triangles;
The texture coordinate determining unit is used to adopt presetting rule, at each summit corresponding texture coordinate is set;
Rendering unit is used for playing up according to apex coordinate and texture coordinate, obtains the river.
8, system as claimed in claim 7 is characterized in that, also comprises a time dependent variable in the described texture coordinate, to realize dynamic texture.
9, system as claimed in claim 7 is characterized in that, the parameter of first segment of curve in the described curve chain also comprises: the initial width and the initial anglec of rotation.
10, system as claimed in claim 7 is characterized in that, when described curve chain was the vector chain, described summit determining unit further comprised:
Be used for this vector is divided into the subelement of predetermined hop count;
Be used for length and direction, obtain the subelement of the length and the direction of each section by this vector;
Be used for obtaining the subelement of the width of each section by initial width of this vector and end width linearity interpolation;
Being used for obtaining each section by the initial anglec of rotation of this vector and end anglec of rotation linear interpolation is center, the subelement that centers on the anglec of rotation of this vector with this vector;
Be used for length, direction, width and the anglec of rotation, determine the subelement that the summit distributes in these vector both sides according to each section.
11, system as claimed in claim 7 is characterized in that, when described curve chain was the Bezier chain, described summit determining unit further comprised:
Be used for this segment of curve is divided into the subelement of predetermined hop count;
Be used for parametric equation, obtain the location point U of each segment by this segment of curve, and the subelement of normal plane;
Be used for the subelement that the initial anglec of rotation and end anglec of rotation linear interpolation by this segment of curve obtain the anglec of rotation of each segment location point U;
Be used for the subelement of determining the normal of each segment location point U according to the anglec of rotation and the normal plane of each segment;
Be used for the subelement that initial width and end width linearity interpolation by this segment of curve obtain the width of each segment location point U;
Be used for width and normal, determine the subelement that the summit distributes according to each segment location point U.
CN200710099168A 2007-05-15 2007-05-15 Method and system for simulating river Active CN100578547C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710099168A CN100578547C (en) 2007-05-15 2007-05-15 Method and system for simulating river

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710099168A CN100578547C (en) 2007-05-15 2007-05-15 Method and system for simulating river

Publications (2)

Publication Number Publication Date
CN101051390A CN101051390A (en) 2007-10-10
CN100578547C true CN100578547C (en) 2010-01-06

Family

ID=38782791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710099168A Active CN100578547C (en) 2007-05-15 2007-05-15 Method and system for simulating river

Country Status (1)

Country Link
CN (1) CN100578547C (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0818277D0 (en) 2008-10-06 2008-11-12 Advanced Risc Mach Ltd Graphics processing system
GB0818279D0 (en) 2008-10-06 2008-11-12 Advanced Risc Mach Ltd Graphics processing systems
GB0818278D0 (en) 2008-10-06 2008-11-12 Advanced Risc Mach Ltd Graphics processing systems
GB0818280D0 (en) 2008-10-06 2008-11-12 Advanced Risc Mach Ltd Graphics processing systems
CN103247064B (en) * 2012-02-14 2016-03-30 中国移动通信集团公司 A kind of generation method of three-dimensional dynamic graphical, device and mobile terminal
CN102722909B (en) * 2012-05-28 2014-07-02 武汉大学 Assembly line topology network dynamic simulation method based on adaptive-dimensional DEM (dynamic effect model)
CN104615823B (en) * 2015-01-30 2018-01-09 天津大学 A kind of method circulated using SWMM software simulating riverways water
CN106157357B (en) * 2015-04-01 2020-02-07 Tcl集团股份有限公司 GPU acceleration-based dynamic light effect implementation method and system
CN104794286B (en) * 2015-04-22 2018-01-12 杭州映墨科技有限公司 A kind of track structure and movement calculation method for virtual reality roller-coaster scene
CN105488261B (en) * 2015-11-25 2019-12-27 天脉聚源(北京)科技有限公司 Method and device for simulating line segments in real time
CN106934205A (en) * 2015-12-31 2017-07-07 阿里巴巴集团控股有限公司 The methods of exhibiting and device of a kind of data correlation relation
CN107564079A (en) * 2017-08-28 2018-01-09 北京白鹭时代信息技术有限公司 A kind of undulating topography generation method
CN109966739B (en) * 2019-01-17 2022-11-11 珠海金山数字网络科技有限公司 Method and system for optimizing game operation
CN111310089B (en) * 2020-02-17 2023-04-28 自然资源部第三地理信息制图院 Vector river network data online rapid loading and rendering method suitable for scale
CN111803949B (en) * 2020-05-27 2023-12-29 深圳雷霆数字娱乐有限公司 River path generation method and system in online game
CN112801126A (en) * 2020-12-01 2021-05-14 中国水利水电科学研究院 River form similarity identification method based on river characteristic points
CN112651091B (en) * 2020-12-21 2022-11-11 东南大学 Rigid body chain connection method based on deformable rigid body mechanism comprehensive theory
CN114020943B (en) * 2022-01-05 2022-03-29 武汉幻城经纬科技有限公司 Basin water surface mixing drawing method and system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN101051390A (en) 2007-10-10

Similar Documents

Publication Publication Date Title
CN100578547C (en) Method and system for simulating river
KR100914846B1 (en) Method and system for texturing of 3d model in 2d environment
US6704018B1 (en) Graphic computing apparatus
CN103700143B (en) A kind of Three-Dimensional Dynamic ocean simulation method drawn based on GPU multipass
CN109427088A (en) A kind of rendering method and terminal of illumination simulation
US7173622B1 (en) Apparatus and method for generating 3D images
Nießner et al. Real‐time rendering techniques with hardware tessellation
US9177421B2 (en) Hair meshes
Schäfer et al. State of the Art Report on Real-time Rendering with Hardware Tessellation.
CN116670723A (en) System and method for high quality rendering of composite views of customized products
CN105184843B (en) A kind of three-dimensional animation manufacturing method based on OpenSceneGraph
Krs et al. Skippy: Single view 3D curve interactive modeling
CN111091620A (en) Map dynamic road network processing method and system based on graphics and computer equipment
Nah et al. MobiRT: an implementation of OpenGL ES-based CPU-GPU hybrid ray tracer for mobile devices
KR20180088876A (en) Image processing method and apparatus
CN106716500A (en) Program, information processing device, depth definition method, and recording medium
CN105894560B (en) A kind of method of image procossing, user equipment and system
KR20080018405A (en) Computer-readable recording medium for recording of 3d terrain production program
CN107943479B (en) Method, device and equipment for defining physical boundary in graphical user interface
Lin et al. A feature-adaptive subdivision method for real-time 3D reconstruction of repeated topology surfaces
US20210375041A1 (en) System for Procedural Generation of Braid Representations in a Computer Image Generation System
WO2024011733A1 (en) 3d image implementation method and system
Jung et al. GeoMaTree: Geometric and Mathematical model based digital tree authoring system
Xu et al. A computational approach to digital Chinese painting and calligraphy
Mason et al. Eastern perspectives and the question of personal expression

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant