CN102722647A - Method and device for generating strip particle path on basis of motion path - Google Patents

Method and device for generating strip particle path on basis of motion path Download PDF

Info

Publication number
CN102722647A
CN102722647A CN2012101740095A CN201210174009A CN102722647A CN 102722647 A CN102722647 A CN 102722647A CN 2012101740095 A CN2012101740095 A CN 2012101740095A CN 201210174009 A CN201210174009 A CN 201210174009A CN 102722647 A CN102722647 A CN 102722647A
Authority
CN
China
Prior art keywords
frame
position information
generating
previous frame
last frame
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.)
Granted
Application number
CN2012101740095A
Other languages
Chinese (zh)
Other versions
CN102722647B (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 Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software 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 Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN201210174009.5A priority Critical patent/CN102722647B/en
Publication of CN102722647A publication Critical patent/CN102722647A/en
Application granted granted Critical
Publication of CN102722647B publication Critical patent/CN102722647B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method and a device for generating a strip particle path on the basis of a motion path. The method comprises the following steps: A, according to a preset sampling frequency, acquiring and storing position information of a current frame on the motion path; B, triggering strip particles between the position of a prevframe of a previous frame and the position of the previous frame and according to the acquired information information, generating a Hermite spline to carry out rendering; C, judging whether the generated Hermite spline is positioned between a previous frame of a last frame and a prevframe of the previous frame of the last frame, if yes, returning to execute the step A, and if no, executing the step D; and D, updating the position information of a previous frame of the current frame into the position information of the last frame, updating the position information of the prevframe of the previous frame of the current frame into the position information of the previous frame of the last frame, generating a Hermite spline between the position of the prevframe of the previous frame and the position of the previous frame and finishing the flow. The application of the method and the device which are disclosed by the invention can improve the rendered particle effect.

Description

Method and device for generating strip particle path based on motion path
Technical Field
The present invention relates to computer technologies, and in particular, to a method and an apparatus for generating a stripe particle path based on a motion path.
Background
At present, in most 3D network games, it is difficult to achieve a visual effect with a sense of reality by using a conventional rendering technology. In order to make the player have better game experience and improve the bringing-in degree of the game, a particle system technology for simulating a scene with a fuzzy phenomenon in three-dimensional computer graphics is often adopted to simulate abstract visual effects of fire, explosion, smoke, water flow, sparks, fallen leaves, cloud, fog, snow, dust, meteor trail or luminous track and the like. For example, when setting the game character release skill, a particle effect similar to a trailing knife light is added to a weapon hanging point of the game character, so that the knife light effect is bound to the weapon hanging point of the game character, and a corresponding particle path is generated along the motion path of the game character. The hanging point is a mode of binding a plurality of entities in the game together, the entities are in contact with other entities through the hanging point, and when the plurality of entities are connected through the hanging point, the position and the angle of the other entities can be influenced by the movement and the rotation of one entity.
The existing particle effect is generally manufactured and described by adopting a strip-shaped particle (strip particle) path, namely, the strip particle path is generated based on the motion path of a game role, the strip particle is one of particle systems, and the strip particle path can be generated according to the position of a hanging point (the motion path of the game role), so that rendering is realized, the striking effect of the game role in releasing skills can be greatly enhanced, and the effect expression of the whole game in fighting is improved.
Fig. 1 is a schematic flow chart of a conventional method for generating a stripe particle path based on a motion path. Referring to fig. 1, the process includes:
step 101, acquiring position information of a frame corresponding to a current hanging point on a motion path according to a preset sampling frequency;
in this step, the hanging point moves according to a preset bezier curve (motion path), and in the process of moving the hanging point, in order to generate the stripe particle to add the particle effect, the position of the frame corresponding to the current hanging point on the bezier curve, that is, the position information of the current frame, needs to be acquired according to a preset sampling frequency, so as to generate the stripe particle path and perform rendering.
The number of frames for generating the slice particles may be determined by the sampling frequency and the sampling time, for example, at a sampling frequency of 30 frames per second (fps), a sampling time of 0.5 seconds, and a number of frames for generating the slice particles of 15 frames.
Step 102, triggering the strip particle from the position of the previous frame to the position of the current frame, pulling a straight line to connect the two position points, and generating a strip particle path for rendering;
in this step, the hanging point at each sampling point corresponds to one frame, that is, the position of the frame corresponds to the position of the hanging point at the sampling time, the hanging point corresponds to different frames at different sampling times, and the position of the frame is updated according to the motion path of the hanging point on the bezier curve. After the position information of the previous frame and the position information of the current frame are obtained, a straight line is pulled out between the position of the hanging point of the current frame and the position of the hanging point of the previous frame by the stripe particle, the two position points are connected, a stripe particle path is generated, and therefore the stripe particle path from the previous frame to the current frame is rendered.
And 103, repeatedly executing the step 101 until the current frame is the last frame in the preset sampling time and generating a stripe particle path.
In the step, in the sampling time, according to the sampling frequency, the hanging points moving on the Bezier curve are sequentially subjected to frame sampling, and the positions of the previous frame and the current frame obtained by sampling are sequentially connected by straight lines, so that a stripe particle path is generated to show the particle effect.
Fig. 2 is a schematic diagram of the effect of the stripe particle path generated based on fig. 1. Referring to fig. 2, it is assumed that a total of 5 frames need to be rendered, where black dots represent positions where hanging points are respectively located from frame 1 to frame 5, thin solid lines represent movement tracks of the hanging points, that is, movement tracks of the hanging points along a bezier curve, and thick solid lines represent generated strip particle paths.
As can be seen from the above description, in the conventional method for generating a stripe particle path based on a motion path, positions of two adjacent frames are connected by a straight line to form the stripe particle path, so that the stripe particle path is generated by straight line connection according to the position of an attached hanging point, the position of the hanging point is updated once per frame, and under the existing hardware condition, the rendering speed of an application-level graph is generally between 30fps and 60 fps. When the frame sampling rate is higher, more frames can be collected in the motion path with the same length, so that more line segments can be generated by the strip particle to form a strip particle path, and the generated strip particle path is more consistent with the motion path, the quality is relatively higher, and the rendered particle effect is better. However, if the moving speed of the hanging point is fast and the frame sampling rate for generating the stripe particle is not high, the generated stripe particle path is not matched with the motion path, the rendered particle effect is poor, and the user experience is reduced.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method for generating a stripe particle path based on a motion path, so as to improve a rendered particle effect.
Another objective of the present invention is to provide an apparatus for generating a stripe particle path based on a motion path, so as to improve a rendered particle effect.
To achieve the above object, the present invention provides a method for generating a strip particle path based on a motion path, the method comprising:
A. acquiring and storing position information of a frame corresponding to the current hanging point on a motion path according to a preset sampling frequency;
B. triggering the strip particles between the position of the previous frame and the position of the previous frame, generating a formula according to a preset Hermite spline curve, and generating a Hermite spline curve connecting two position points according to the acquired position information to render;
C. judging whether the generated Hermite spline curve is positioned between the last frame of the last frame and the last frame of the last frame in the sampling time, if not, returning to execute the step A, and if so, executing the step D;
D. and updating the position information of the last frame of the current frame as the position information of the last frame, generating an Hermite spline curve between the position of the last frame and the position of the last frame according to a preset Hermite spline curve generation formula, and ending the flow.
The Hermite spline curve generation formula is as follows:
P(u)=pkH0(u)+pk+1H1(u)+DpkH2(u)+Dpk+1H3(u)
in the formula,
u is a time parameter;
p (u) is a frame pkTo frame pk+1Generating a formula by using a Hermite spline curve;
k is a frame identifier;
pkposition information of a previous frame that is a previous frame;
H0(u)、H1(u)、H2(u)、H3(u) is a mixing function;
pk+1position information of a previous frame;
Dpka parameter derivative of a position of a previous frame of the previous frame;
Dpk+1the derivative of the parameter at the location of the previous frame.
The time parameter calculation formula is as follows:
u = t - t 0 t 1 - t 0
in the formula,
t is the current sampling time;
t0is the sampling start point time;
t1is the sampling end point time.
The mixing function calculation formula is as follows:
H0(u)=2u3-3u2+1;
H1(u)=-2u3+3u2
H2(u)=u3-2u2+u;
H3(u)=u3-u2
the parameter derivative calculation formula is as follows:
Dpk=pk+1-pk
Dpk+1=pk+2-pk+1
in the formula,
pk+2is the position information of the current frame.
An apparatus for generating a strip particle path based on a motion path, the apparatus comprising: a position information acquisition module, a strip particle path generation module and a judgment module, wherein,
the position information acquisition module is used for acquiring and storing the position information of the frame corresponding to the current hanging point on the motion path in sampling time according to the preset sampling frequency; receiving the updating information output by the judging module, updating the stored position information of the previous frame of the current frame to be the position information of the last frame, and the position information of the previous frame of the current frame to be the position information of the previous frame of the last frame;
the strip particle path generating module is used for triggering the strip particles between the position of the last frame and the position of the last frame according to the position information stored by the position information acquiring module, generating a Hermite spline curve connecting the two position points according to a preset Hermite spline curve generating formula, and rendering the Hermite spline curve;
a judging module, configured to judge whether the hermitian spline generated by the strip particle path generating module is located between a frame immediately preceding a last frame in the sampling time and a frame immediately preceding the last frame in the sampling time:
if not, further judging whether the Hermite spline curve is positioned between the last frame in the sampling time and the last frame of the last frame, if not, outputting continuous sampling information to the position information acquisition module, and if so, ending the process;
if yes, updating information is output to the position information acquisition module.
The position information acquisition module includes: a position information acquiring unit, a first storage unit, a second storage unit, and a third storage unit, wherein,
the position information acquisition unit is used for acquiring the position information of a frame corresponding to the current hanging point on a motion path in sampling time according to a preset sampling frequency and outputting the position information to the first storage unit;
a first storage unit for outputting the stored location information to the second storage unit and replacing the stored location information with the received location information, when the location information is received;
a second storage unit for outputting the stored location information to a third storage unit and replacing the stored location information with the received location information, when the location information is received;
a third storage unit for, upon receiving the location information, replacing the stored location information with the received location information.
According to the technical scheme, the method and the device for generating the strip particle path based on the motion path provided by the invention have the advantages that A, according to the preset sampling frequency, the position information of the frame corresponding to the current hanging point on the motion path is obtained and stored; B. triggering the strip particles between the position of the previous frame and the position of the previous frame, generating a formula according to a preset Hermite spline curve, and generating a Hermite spline curve connecting two position points according to the acquired position information to render; C. judging whether the generated Hermite spline curve is positioned between the last frame of the last frame and the last frame of the last frame in the sampling time, if not, returning to execute the step A, and if so, executing the step D; D. and updating the position information of the last frame of the current frame as the position information of the last frame, generating an Hermite spline curve between the position of the last frame and the position of the last frame according to a preset Hermite spline curve generation formula, and ending the flow. Therefore, the positions of two adjacent frames are connected by adopting a Hermite spline curve, so that the strip particle path is smooth, the same part as the previously generated strip particle path can be compatible, the particle effect has continuity, and the rendered particle effect is improved.
Drawings
Fig. 1 is a schematic flow chart of a conventional method for generating a stripe particle path based on a motion path.
Fig. 2 is a schematic diagram of the effect of the stripe particle path generated based on fig. 1.
Fig. 3 is a flowchart illustrating a method for generating a stripe particle path based on a motion path according to an embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating the effect of the stripe particle path generated based on fig. 3 according to the embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an apparatus for generating a stripe particle path based on a motion path according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
In the existing method for generating a stripe particle path based on a motion path, positions of two adjacent frames are connected by a straight line to form the stripe particle path, and under the conditions that a hanging point has a high moving speed and a frame sampling rate is not high, the generated stripe particle path is not matched with the motion path, so that a rendered particle effect is poor. That is to say, too few frame sampling numbers corresponding to the hanging points and too large angle changes of the hanging point positions between adjacent frames will cause the generated stripe particle path to be hard, and due to the limitation of the current hardware computing capability, on the premise of meeting the rendering computing requirement, the frame sampling frequency can not be greatly improved basically. In the embodiment of the present invention, in order to enable the stripe particle path to generate a smooth transition effect when the angle changes and the frame sampling number is too small, it is considered to adopt a curve processing manner to connect the positions of two adjacent frames by a curve, so that the stripe particle path is smooth, that is, a stripe particle with a smooth path is generated.
In the embodiment of the invention, the position information of each frame on the motion path can be obtained by sampling the hanging points on the motion path to form a group of specified position information point sets, so that the method is very suitable for generating the curve simulation path by selecting and using the spline curve.
In the embodiment of the present invention, according to the generation characteristic of the stripe particle path, the generated curve stripe particle path should not be affected by the newly added frame after the newly added frame, that is, the stripe particle path generated between the previous frame and the current frame is independent from the stripe particle path generated between the current frame and the next frame. For example, if there are 3 frames currently, a stripe particle path from the first frame to the third frame (including a stripe particle path from the first frame to the second frame and a stripe particle path from the second frame to the third frame) is generated through the curve processing, after a sampling time, the position information of the fourth frame is obtained, and then through the same curve processing, the stripe particle path from the first frame to the third frame needs to be kept unchanged, that is, the stripe particle path from the first frame to the third frame in the newly generated stripe particle paths is the same as the previously generated stripe particle path. Therefore, the particle effect is continuous and better. Therefore, in the embodiment of the present invention, a spline curve generation manner of an additional control frame is not needed between two sampled frames, that is, position information of other control frames is not included between two adjacent frames, and when a frame is newly added and a stripe particle path is generated, the same part as the previously generated stripe particle path can be compatible in the later generated stripe particle path, so that modifying any one control frame does not affect the whole stripe particle path.
Based on the above consideration, in the embodiment of the present invention, an Hermite (Hermite) spline is used to simulate the stripe particle path, and of course, in practical applications, other splines without an additional control frame may also be used to simulate the stripe particle path.
Fig. 3 is a flowchart illustrating a method for generating a stripe particle path based on a motion path according to an embodiment of the present invention. Referring to fig. 3, the process includes:
step 301, acquiring and storing position information of a frame (current frame) corresponding to a current hanging point on a motion path according to a preset sampling frequency;
this step is the same as step 101 and will not be described herein again.
Step 302, triggering a strip particle between the position of the previous frame and the position of the previous frame, generating a formula according to a preset Hermite spline curve, and generating a Hermite spline curve connecting two position points according to the acquired position information to render;
in the step, the Hermite spline curve generation formula is a segmented cubic polynomial, a given tangent line is arranged at each frame position point, and the curve of each segment only depends on end point constraint, namely the constraint of the position of the starting frame and the position of the ending frame, so that the Hermite curve can be locally adjusted, and the curves of each segment are independent.
The Hermite spline curve generation formula is as follows:
P(u)=pkH0(u)+pk+1H1(u)+DpkH2(u)+Dpk+1H3(u)
in the formula,
u is a time parameter;
p (u) is a frame pkTo frame pk+1Between Hermite spline curve generation formula, i.e. generating pk~pk+1A formula of a segment spline curve;
k is a frame identifier;
pkposition information of a previous frame that is a previous frame;
H0(u)、H1(u)、H2(u)、H3(u) is a mixing function;
pk+1position information of a previous frame;
Dpkthe parameter derivative of the position of the previous frame, namely the slope of the Hermite spline curve at the position;
Dpk+1the derivative of the parameter at the location of the previous frame.
Wherein,
u = t - t 0 t 1 - t 0
where t is the current sampling time, t0To sample the starting point time, t1Is the sampling end point time.
H0(u)=2u3-3u2+1
H1(u)=-2u3+3u2
H2(u)=u3-2u2+u
H3(u)=u3-u2
Dpk=pk+1-pk
Dpk+1=pk+2-pk+1
In the formula, pk+2Is the position information of the current frame.
In practical applications, for the case that the current frame is the last frame obtained after sampling, the parameter derivative of the position where the next frame of the current frame is located may be set to be zero.
As can be seen from the above formula, under the condition of acquiring the position information of the current frame, the Hermite spline curve generation formula can generate a curve between the position of the previous frame and the position of the previous frame. In the embodiment of the invention, in order to ensure the smooth transition of the strip particle path generated between the frames, the difference between the position information of the current frame and the position information of the previous frame is set as the approximate value of the parameter derivative (tangent) of the position of the previous frame, so that the calculation is simple, the requirement can be met, the curve between the position of the previous frame and the curve between the position of the previous frame and the position of the current frame, which are generated, can be ensured to have the smooth transition effect at the position of the previous frame, namely, the generated front and rear section curves can be smoothly transitioned at the intersectionAnd (4) excessive. For example, if there are 4 frames, the position information thereof corresponds to the front and rear neighboring points p in sequence0、p1、p2、p3Passing the point p according to the above Hermite spline curve generation formula0、p1、p2The point p can be obtained0Derivative of a parameter and point p1And generates a point p0To point p1Hermite spline curve S in between0,1(ii) a Passing through point p1、p2、p3The point p can be obtained1Derivative of a parameter and point p2And generates a point p1To point p2Hermite spline curve S in between1,2Due to the curve S0,1And curve S1,2At point p1The derivative of the parameter, i.e. the curve at point p1The slope of (a) is the same, thus, passing through point p1、p2Position information calculation point p of1So that the curve S can be guaranteed0,1To curve S1,2Has the effect of smooth transition.
The program code for generating the Hermite spline curve is as follows:
Figure BDA00001701305200101
Figure BDA00001701305200111
in the program code, f is a definition mode of a single-precision floating point number (float) in the c + + program, which indicates that 0.5 is a single-precision floating point number. It can be seen that if p is to be generated0To p1Curve of segment, according to ppreAnd pnextPosition generation p of0And p1So that a smooth transition between different curve segments is ensured.
Therefore, after the position information of the current frame is obtained, the strip particle can be drawn out of the position of the hanging point of the previous frame and the position of the hanging point of the previous frame according to the Hermite spline curve generation formula, a smooth curve is drawn out, the two position points are connected, and a strip particle path is generated, so that the rendering of the path from the previous frame to the previous frame of the previous frame is realized.
For example, assume that the point corresponding to the position information of the current hanging point is p4Then the spline generated for the current frame is p1~p2Segment because p is generated1~p2Segment spline curve requires reference p0、p3To calculate p1、p2The tangent values at two points, so a delay of one frame is required.
Step 303, judging whether the generated Hermite spline curve is positioned between the last frame of the last frame and the last frame of the last frame in the sampling time, if not, returning to execute step 301, and if so, executing step 304;
in the step, in sampling time, according to sampling frequency, frame sampling is sequentially carried out on hanging points moving on a Bessel curve, and between the position of the previous frame obtained by sampling and the position of the previous frame, an Hermite spline curve is generated according to a Hermite spline curve generation formula, so that a strip particle path is formed, and the particle effect is displayed.
In the embodiment of the invention, if the frame corresponding to the current hanging point is the first frame or the second frame, the processing of generating the Hermite spline curve is not carried out.
After the hermitian spline curve is generated, whether the generated hermitian spline curve is positioned between the last frame of the last frame and the last frame of the last frame in the sampling time needs to be judged, if so, the situation that the frame corresponding to the current hanging point is the last frame and is already between the last frame of the frame and the last frame of the last frame is shown, the hermitian spline curve connecting two position points is generated, because the hermitian spline curve between the frame and the last frame of the frame is generated, the position information of the next frame of the last frame is needed, and the last frame is sampled when the sampling is finished, the special processing needs to be carried out on the next frame of the last frame.
Of course, in practical applications, if the sampling is performed according to the preset sampling frequency to obtain the position information, when it is determined that the generated hermitian spline curve is not located between the previous frame of the last frame and the previous frame of the last frame within the sampling time, the current frame may also be updated, that is, the current frame points to the next frame of the current frame, and the step 302 is executed again.
And 304, updating the position information of the previous frame of the current frame as the position information of the last frame, updating the position information of the previous frame of the current frame as the position information of the previous frame of the last frame, generating an Hermite spline curve between the position of the previous frame and the position of the previous frame according to a preset Hermite spline curve generation formula, and rendering and ending the process.
In this step, if the frame corresponding to the current hanging point is the last frame and the hermitian spline connecting the two position points is generated between the previous frame of the frame and the previous frame of the frame, the hermitian spline between the position of the previous frame of the last frame and the position of the last frame can be generated by setting the parameter derivative of the position of the current frame to zero, that is, setting the position information of the current frame and the previous frame of the current frame as the position information of the last frame and setting the position information of the previous frame of the current frame as the position information of the previous frame of the last frame as described above.
Fig. 4 is a schematic diagram illustrating the effect of the stripe particle path generated based on fig. 3 according to the embodiment of the present invention. Referring to fig. 4, the thin solid line is the strip particle path generated by the present invention, the thick solid line is the strip particle path generated by the prior art, and the dotted solid line is the motion path of the hanging point. Therefore, compared with the existing stripe particle path generation mode, the Hermite spline curve generation formula is adopted, under the same frame number, the stripe particle path generated by the embodiment of the invention is more smooth, the problem of hard trimming when the hanging point angle changes in the prior art is solved, the particle rendering effect is greatly improved, the game quality is improved, and the bring-in feeling of the game to users is increased.
In practical application, when the rendering frequency reaches more than 30fps, the current hanging point position is delayed by one frame to generate a strip particle path, and compared with the motion of the hanging point in the current frame, the influence on vision is small, and no obvious change is sensed basically.
Fig. 5 is a schematic structural diagram of an apparatus for generating a stripe particle path based on a motion path according to an embodiment of the present invention. Referring to fig. 5, the apparatus includes: a position information acquisition module, a strip particle path generation module and a judgment module, wherein,
the position information acquisition module is used for acquiring and storing the position information of the frame corresponding to the current hanging point on the motion path in sampling time according to the preset sampling frequency; receiving the updating information output by the judging module, updating the stored position information of the previous frame of the current frame to be the position information of the last frame, and the position information of the previous frame of the current frame to be the position information of the previous frame of the last frame;
in the embodiment of the present invention, a frame identifier may be set for a frame to identify the frame, for example, if the sampling frequency is 30fps, the sampling time is 0.5 seconds, and the number of frames for generating a stripe particle is 15 frames, 0 to 14 may be set for identifying the frame. If the frame identification of the current frame is 10, the frame identification of the previous frame of the current frame is 9, and the frame identification of the previous frame of the current frame is 8.
Since the generation mode of the hermitian spline is only related to the position information of the next frame of the current frame, the previous frame of the current frame and the previous frame of the current frame, in order to reduce the space required for storage and improve the storage efficiency, three storage units can be arranged in the position information acquisition module and are respectively used for storing the position information of the current frame, the position information of the previous frame of the current frame and the position information of the previous frame of the current frame.
The position information acquisition module includes: a position information acquiring unit, a first storage unit, a second storage unit, and a third storage unit (not shown in the figure), wherein,
the position information acquisition unit is used for acquiring the position information of a frame corresponding to the current hanging point on a motion path in sampling time according to a preset sampling frequency and outputting the position information to the first storage unit;
a first storage unit for outputting the stored location information to the second storage unit and replacing the stored location information with the received location information, when the location information is received;
a second storage unit for outputting the stored location information to a third storage unit and replacing the stored location information with the received location information, when the location information is received;
a third storage unit for, upon receiving the location information, replacing the stored location information with the received location information.
In the embodiment of the present invention, similarly, the storage unit may be identified for identifying and storing the corresponding location information.
The strip particle path generating module is used for triggering the strip particles between the position of the last frame and the position of the last frame according to the position information stored by the position information acquiring module, generating a Hermite spline curve connecting the two position points according to a preset Hermite spline curve generating formula, and rendering the Hermite spline curve;
a judging module, configured to judge whether the hermitian spline generated by the strip particle path generating module is located between a frame immediately preceding a last frame in the sampling time and a frame immediately preceding the last frame in the sampling time:
if not, further judging whether the Hermite spline curve is positioned between the last frame in the sampling time and the last frame of the last frame, if not, outputting continuous sampling information to the position information acquisition module, and if so, ending the process;
if yes, updating information is output to the position information acquisition module.
The following describes a method for generating a stripe particle path based on a motion path according to an embodiment of the present invention.
It is assumed that, within the sampling time, points corresponding to the position information of the adjacent 6 hanging points are obtained by sampling in sequence, that is, the position information of the 6 hanging points is known, and the following are respectively: p is a radical of0、p1、p2、p3、p4、p5In the embodiment of the invention, a curve passing through the 6 points is calculated by a Hermite spline curve generation formula:
(1) for p0~p1Section curve, p0The tangent line of (b) requires a special designation, designated as: p is a radical ofpre=p0,Dp0=p0-ppre=0;
(2) For p1~p2、p2~p3、p3~p4The segment curve can be calculated according to a Hermite spline curve generation formula;
in the step, a Hermite spline curve generation formula can be used in the particle rendering by a method of delaying one-frame rendering, so that the rendering quality of the stripe particles is improved. Suppose that the point corresponding to the position information of the current hanging point is p3Correspondingly, the current frame is p3The last frame is p2The previous frame of the previous frame is p1. Due to p4The position information of (D) is unknown, and thus, Dp cannot be calculated3=p4-p3So only delaying rendering a frame, i.e. hanging point walk to p4Then there is enough information to calculate p2~p3Curve of (c) when the hanging point goes to p4Then, the current frame is updated to p accordingly4The last frame is p3The previous frame of the previous frame is p2
(3)、p4~p5Section curve, p5The tangent line of (b) requires a special designation, designated as: p is a radical ofNext=p5,Dp5=pNext-p5=0。
The step is summarized, and after all paths are sampled by the hanging point, the hanging point stays at the final position and does not move until the particle is deleted. Before being deleted, the above process is executed, except that p2、p3、p4、p5All at the same position, a curve of length 0 is generated.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A method of generating a strip particle path based on a motion path, the method comprising:
A. acquiring and storing position information of a frame corresponding to the current hanging point on a motion path according to a preset sampling frequency;
B. triggering the strip particles between the position of the previous frame and the position of the previous frame, generating a formula according to a preset Hermite spline curve, and generating a Hermite spline curve connecting two position points according to the acquired position information to render;
C. judging whether the generated Hermite spline curve is positioned between the last frame of the last frame and the last frame of the last frame in the sampling time, if not, returning to execute the step A, and if so, executing the step D;
D. and updating the position information of the last frame of the current frame as the position information of the last frame, generating an Hermite spline curve between the position of the last frame and the position of the last frame according to a preset Hermite spline curve generation formula, and ending the flow.
2. The method of claim 1, wherein the Hermite spline curve generation formula is:
P(u)=pkH0(u)+pk+1H1(u)+DpkH2(u)+Dpk+1H3(u)
in the formula,
u is a time parameter;
p (u) is a frame pkTo frame pk+1Generating a formula by using a Hermite spline curve;
k is a frame identifier;
pkposition information of a previous frame that is a previous frame;
H0(u)、H1(u)、H2(u)、H3(u) is a mixing function;
pk+1position information of a previous frame;
Dpka parameter derivative of a position of a previous frame of the previous frame;
Dpk+1the derivative of the parameter at the location of the previous frame.
3. The method of claim 2, wherein the time parameter calculation formula is:
u = t - t 0 t 1 - t 0
in the formula,
t is the current sampling time;
t0is the sampling start point time;
t1is the sampling end point time.
4. The method of claim 2, wherein the mixing function is calculated by the formula:
H0(u)=2u3-3u2+1;
H1(u)=-2u3+3u2
H2(u)=u3-2u2+u;
H3(u)=u3-u2
5. the method of claim 2, wherein the parametric derivative calculation formula is:
Dpk=pk+1-pk
Dpk+1=pk+2-pk+1
in the formula,
pk+2is the position information of the current frame.
6. An apparatus for generating a ribbon particle path based on a motion path, the apparatus comprising: a position information acquisition module, a strip particle path generation module and a judgment module, wherein,
the position information acquisition module is used for acquiring and storing the position information of the frame corresponding to the current hanging point on the motion path in sampling time according to the preset sampling frequency; receiving the updating information output by the judging module, updating the stored position information of the previous frame of the current frame to be the position information of the last frame, and the position information of the previous frame of the current frame to be the position information of the previous frame of the last frame;
the strip particle path generating module is used for triggering the strip particles between the position of the last frame and the position of the last frame according to the position information stored by the position information acquiring module, generating a Hermite spline curve connecting the two position points according to a preset Hermite spline curve generating formula, and rendering the Hermite spline curve;
a judging module, configured to judge whether the hermitian spline generated by the strip particle path generating module is located between a frame immediately preceding a last frame in the sampling time and a frame immediately preceding the last frame in the sampling time:
if not, further judging whether the Hermite spline curve is positioned between the last frame in the sampling time and the last frame of the last frame, if not, outputting continuous sampling information to the position information acquisition module, and if so, ending the process;
if yes, updating information is output to the position information acquisition module.
7. The apparatus of claim 6, wherein the location information acquisition module comprises: a position information acquiring unit, a first storage unit, a second storage unit, and a third storage unit, wherein,
the position information acquisition unit is used for acquiring the position information of a frame corresponding to the current hanging point on a motion path in sampling time according to a preset sampling frequency and outputting the position information to the first storage unit;
a first storage unit for outputting the stored location information to the second storage unit and replacing the stored location information with the received location information, when the location information is received;
a second storage unit for outputting the stored location information to a third storage unit and replacing the stored location information with the received location information, when the location information is received;
a third storage unit for, upon receiving the location information, replacing the stored location information with the received location information.
CN201210174009.5A 2012-05-30 2012-05-30 A kind of method and device generating band particle path based on motion path Active CN102722647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210174009.5A CN102722647B (en) 2012-05-30 2012-05-30 A kind of method and device generating band particle path based on motion path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210174009.5A CN102722647B (en) 2012-05-30 2012-05-30 A kind of method and device generating band particle path based on motion path

Publications (2)

Publication Number Publication Date
CN102722647A true CN102722647A (en) 2012-10-10
CN102722647B CN102722647B (en) 2016-01-06

Family

ID=46948404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210174009.5A Active CN102722647B (en) 2012-05-30 2012-05-30 A kind of method and device generating band particle path based on motion path

Country Status (1)

Country Link
CN (1) CN102722647B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107945243A (en) * 2017-11-23 2018-04-20 杭州电魂网络科技股份有限公司 image moving method and device
CN107978014A (en) * 2017-12-21 2018-05-01 乐蜜有限公司 A kind of particle renders method, apparatus, electronic equipment and storage medium
CN109646957A (en) * 2018-12-19 2019-04-19 北京像素软件科技股份有限公司 Special efficacy implementation method of trailing and device
CN111558223A (en) * 2020-04-17 2020-08-21 完美世界(北京)软件科技发展有限公司 Method and device for generating trailing special effect, storage medium and computer equipment
CN112947490A (en) * 2021-04-09 2021-06-11 京东数科海益信息科技有限公司 Path smoothing method, device, equipment, storage medium and product
WO2023109555A1 (en) * 2021-12-13 2023-06-22 北京字跳网络技术有限公司 Fluid particle rendering method, apparatus, system, and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216957A (en) * 2008-01-10 2008-07-09 中山大学 A human model design method based on hybrid interpolation parameterization
CN101299279A (en) * 2008-06-11 2008-11-05 中国科学院计算技术研究所 Aerial movement simulating method based on key frame time optimization
US7803054B1 (en) * 2004-03-31 2010-09-28 Microsoft Corporation Multi-vehicle cross-network coordination

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7803054B1 (en) * 2004-03-31 2010-09-28 Microsoft Corporation Multi-vehicle cross-network coordination
CN101216957A (en) * 2008-01-10 2008-07-09 中山大学 A human model design method based on hybrid interpolation parameterization
CN101299279A (en) * 2008-06-11 2008-11-05 中国科学院计算技术研究所 Aerial movement simulating method based on key frame time optimization

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
冯洪奎 等: "在视景仿真中用Hermite曲线控制物体运动", 《系统仿真学报》 *
胡迎辉: "几何Hermite插值曲线的优化方法研究", 《中国优秀硕士学位论文全文数据库(基础科学辑)》 *
袁铨 等: "基于Hermite样条曲线的关键帧插值角色动画", 《计算机与现代化》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107945243A (en) * 2017-11-23 2018-04-20 杭州电魂网络科技股份有限公司 image moving method and device
CN107945243B (en) * 2017-11-23 2021-04-27 杭州电魂网络科技股份有限公司 Image moving method and device
CN107978014A (en) * 2017-12-21 2018-05-01 乐蜜有限公司 A kind of particle renders method, apparatus, electronic equipment and storage medium
CN109646957A (en) * 2018-12-19 2019-04-19 北京像素软件科技股份有限公司 Special efficacy implementation method of trailing and device
CN109646957B (en) * 2018-12-19 2022-03-25 北京像素软件科技股份有限公司 Method and device for realizing tailing special effect
CN111558223A (en) * 2020-04-17 2020-08-21 完美世界(北京)软件科技发展有限公司 Method and device for generating trailing special effect, storage medium and computer equipment
CN111558223B (en) * 2020-04-17 2023-06-13 完美世界(北京)软件科技发展有限公司 Method and device for generating tailing special effects, storage medium and computer equipment
CN112947490A (en) * 2021-04-09 2021-06-11 京东数科海益信息科技有限公司 Path smoothing method, device, equipment, storage medium and product
WO2023109555A1 (en) * 2021-12-13 2023-06-22 北京字跳网络技术有限公司 Fluid particle rendering method, apparatus, system, and storage medium

Also Published As

Publication number Publication date
CN102722647B (en) 2016-01-06

Similar Documents

Publication Publication Date Title
CN102722647B (en) A kind of method and device generating band particle path based on motion path
US10628675B2 (en) Skeleton detection and tracking via client-server communication
US10805662B2 (en) Predictive server-side rendering of scenes
KR102342933B1 (en) Information processing device, control method of information processing device, and storage medium
US9381429B2 (en) Compositing multiple scene shots into a video game clip
Cutting et al. Visual activity in Hollywood film: 1935 to 2005 and beyond.
US10863210B2 (en) Client-server communication for live filtering in a camera view
CN110262730A (en) Edit methods, device, equipment and the storage medium of game virtual resource
JP2010033296A (en) Program, information storage medium, and image generation system
CN109939438A (en) Track display method and device, storage medium and electronic device
Smelik et al. Semantic constraints for procedural generation of virtual worlds
CN112156462A (en) Animation processing method and device for game skill
CN104700384A (en) Display system and display method based on augmented reality technology
US10967267B2 (en) Changing a camera view in an electronic game
CN103309444A (en) Kinect-based intelligent panoramic display method
CN115272057A (en) Training of cartoon sketch image reconstruction network and reconstruction method and equipment thereof
EP4404145A1 (en) Neural extension of 3d content in augmented reality environments
EP4404144A1 (en) Neural extension of 2d content in augmented reality environments
JP2018082849A (en) Image display program, computer apparatus, image display method, server apparatus, and image display system
CN108580154A (en) A kind of fountain simulation system
KR100801900B1 (en) Constrained motion synthesis method by using motion capture data
Szkudlarek et al. Head-coupled perspective in computer games
WO2008098419A1 (en) System and method for producing and playing real time 3d movie/game based on role acting
KR20140103374A (en) System and method for designing virtual world event
CN114173065A (en) Unmanned aerial vehicle control method and device, unmanned aerial vehicle and storage medium

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