CN105118079B - Animation displacement drawing process, device and motion control method, device - Google Patents

Animation displacement drawing process, device and motion control method, device Download PDF

Info

Publication number
CN105118079B
CN105118079B CN201510594717.8A CN201510594717A CN105118079B CN 105118079 B CN105118079 B CN 105118079B CN 201510594717 A CN201510594717 A CN 201510594717A CN 105118079 B CN105118079 B CN 105118079B
Authority
CN
China
Prior art keywords
animation
frame
deformation trace
displacement
former
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
CN201510594717.8A
Other languages
Chinese (zh)
Other versions
CN105118079A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201510594717.8A priority Critical patent/CN105118079B/en
Publication of CN105118079A publication Critical patent/CN105118079A/en
Application granted granted Critical
Publication of CN105118079B publication Critical patent/CN105118079B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a kind of animation displacement drawing process, including:Calculate the displacement difference that current animation needs the target point being moved to and the target point of former animation deformation trace;The bit shift compensation for calculating each frame in former animation deformation trace, makes the size of the bit shift compensation of each frame be proportional to shift length of the frame in former animation deformation trace, and so that the bit shift compensation of all frames in former animation deformation trace is added and be equal to the displacement difference;The bit shift compensation for each frame being calculated is added in the displacement for corresponding to frame in former animation deformation trace, to obtain current animation deformation trace.The animation displacement speed performance that the speed speed performance that animation displacement drawing process disclosed by the invention enables to animation displacement to stretch makes with the original fine arts is consistent, and the athletic performance of object is allowed to be more in line with the expection of player.The embodiment of the invention also discloses a kind of animation displacement stretching device, the motion control methods and device of game object.

Description

Animation displacement drawing process, device and motion control method, device
Technical field
The present invention relates to a kind of game object control field more particularly to animation displacement drawing process, device and game Motion control method, the device of object.
Background technology
The mode of the athletic performance of common control object often has the following two kinds in game:
A kind of mode of control object athletic performance is:The fine arts make the skeleton cartoon in an original place, then programmed logic In control object move, such as personage walking performance, the skeleton cartoon that an original place is walked, then program can be made with the fine arts It allows personage to be moved by certain speed in code logic, reaches personage in the expression effect walked.This mode is suitable for object fortune The more fixed situation of dynamic speed, for example walk, run just is not easy to use but if being the more complex situation in movement velocity, track Programmed logic goes to realize.
The mode of another control object athletic performance is to use animation displacement.In this manner, the fine arts make It is not an original place animation but a skeleton cartoon for carrying displacement, when then playing this animation in gaming, Jiu Huigen Carry out mobile object according to the deformation trace of this animation, the advantages of this mode, which is the performance of object in gaming, to be set with the fine arts Meter it is consistent, can have speed, the complicated variation on track, enhance the expressive force of game object.Therefore this mode is through common In on the athletic movement of game object, for example (centre has certain speed rhythm to become for personage splits toward front jumping in game technical ability Change), the movement of personage is showed in this way, will compare nature.But it in actually using animation displacement, is frequently encountered A problem be that the fine arts, which have made one section of animation deformation trace, can move to some target point opposite with current location, But planning wishes that the object eventually moves to another target point.Still by taking technical ability is split in the jump of personage as an example, what the fine arts may make Deformation trace is to jump ahead at 3 meters, but the target of attack of personage is in practice in front at 5 meters, in this way if still according to Deformation trace originally moves personage, can not just attack target.In this case, it is necessary to according to actual target point, The deformation trace of animation is stretched, 5 meters are stretched to from 3 meters, here it is so-called animation displacement stretching techniques.Here " stretching " is not limited to elongate, it is also possible to be situation about shortening, for example actual target point is closer from object.
The basic ideas of the animation drawing process of game engine on the market are to calculate actual target point and the fine arts at present Displacement difference between the target point of the deformation trace of making obtains one then by this displacement difference divided by the run time of animation This speed is added to object then during animation play, as a compensation speed, exists in this way by a speed After animation play, corresponding object will be equal to that displacement difference there are one bit shift compensation, and it is last right to ensure that in this way As specified target point can be displaced to.
Invention content
Through engineering test the study found that although the animation drawing process scheme of the game engine of the prior art is realized simply, But it is substantially according to time indiscriminate Uniform Tension, and drawing effect is stiff, cannot be satisfied concrete application under particular surroundings.Tool Body:In gaming, it is intended that the process of stretching is can be consistent with the rhythm of original animation itself, for example still split with jumping For technical ability, if it is that stagnant sky is motionless that jump, which splits technical ability in intermediate personage for some time, we also are intended at this section Between do not stretch, if jumped, personage's motion ratio when split end is very fast, and the speed that we also are intended to stretching this period can Than very fast.If the movement produced in stagnant null process because of stretching, it is clear that this is exactly phenomenologically less to meet expection 's.
For technical ability is split in the jump being previously mentioned, if jump split centre have one section of stagnant sky it is motionless when, according to existing This animation displacement Uniform Tension method of technology still suffers from a movement speed superposition up, thus in this period The expection that player shows this technical ability can less be met.Therefore, carry out mobile object using animation displacement in gaming, work as needs Variant between the target point and the target point of original animation that are moved to, when needing to carry out animation displacement stretched operation, use is existing Animation displacement Uniform Tension method can not make animation displacement drawing process movement speed performance meet original animation Movement speed performance, do not meet player to the animation displacement stretch performance expection.
To realize more good animation drawing effect, we have proposed a kind of ideal animation displacements to stretch, ideal dynamic It is to have certain Semantic to draw displacement stretching, and stretching is corresponding fast when the movement in original cartoon track is fast, is drawn when moving slow It stretches also corresponding slow.
To realize that above-mentioned ideal animation displacement stretches, a kind of animation displacement drawing process of present invention offer and device, energy Enough so that the speed speed performance that stretches of animation displacement is consistent with the animation displacement speed performance that the original fine arts make, object is allowed Athletic performance is more in line with the expection of player.
An embodiment of the present invention provides a kind of animation displacement drawing process, including:
Calculate the displacement difference that current animation needs the target point being moved to and the target point of former animation deformation trace;
The bit shift compensation for calculating each frame in former animation deformation trace, makes the size of the bit shift compensation of each frame be proportional to Shift length of the frame in former animation deformation trace, and make the bit shift compensation addition of all frames etc. in former animation deformation trace In the displacement difference;
The bit shift compensation for each frame being calculated is added in the displacement for corresponding to frame in former animation deformation trace, to Obtain current animation deformation trace.
As the improvement of said program, each frame in former animation deformation trace is calculated by following formula (1)~(2) Bit shift compensation:
M (i)=0, i=1 (1)
M (i)=(D-P (N)) * | P (i)-P (i-1) |/S, i >=2 (2)
Wherein, M (i) is the bit shift compensation of the i-th frame in former animation deformation trace, and P (i) is in former animation deformation trace The position of each frame, P (N) are the target point of former animation deformation trace, and D is the target point that current animation needs are moved to, and S is original The total displacement length of animation deformation trace.
As the improvement of said program, current animation deformation trace is calculated by following formula (3)~(6):
V (i)=0, i=1 (3)
V (i)=P (i)-P (i-1)+M (i), i >=2 (4)
Q (i)=P (i), i=1 (5)
Q (i)=Q (i-1)+V (i), i >=2 (6)
Wherein, V (i) is the displacement of the i-th frame in current animation deformation trace, and Q (i) is in current animation deformation trace The position of i-th frame.
As the improvement of said program, the position of each frame in the original animation deformation trace is the coordinate of two dimensional surface The coordinate points of point or three dimensions.
As the improvement of said program, the shift length of each frame in the original animation deformation trace be the frame with it is previous Air line distance between frame;The displacement difference is that the target point of former animation deformation trace is directed toward the mesh that current animation needs are moved to The displacement of punctuate.
Correspondence of the embodiment of the present invention provides a kind of animation displacement stretching device, including:
Displacement difference computing module needs the mesh of the target point being moved to and former animation deformation trace for calculating current animation The displacement difference of punctuate;
Bit shift compensation computing module, the bit shift compensation for calculating each frame in former animation deformation trace, makes each frame The size of bit shift compensation be proportional to shift length of the frame in former animation deformation trace, and make in former animation deformation trace The bit shift compensation of all frames, which is added, is equal to the displacement difference;
Processing module corresponds to frame for the bit shift compensation for each frame being calculated to be added in former animation deformation trace Displacement on, to obtain current animation deformation trace.
As the improvement of said program, the bit shift compensation computing module calculates former animation by following formula (1)~(2) The bit shift compensation of each frame in deformation trace:
M (i)=0, i=1 (1)
M (i)=(D-P (N)) * | P (i)-P (i-1) |/S, i >=2 (2)
Wherein, M (i) is the bit shift compensation of the i-th frame in former animation deformation trace, and P (i) is in former animation deformation trace The position of each frame, P (N) are the target point of former animation deformation trace, and D is the target point that current animation needs are moved to, and S is original The total displacement length of animation deformation trace.
As the improvement of said program, current animation position is calculated by following formula (3)~(6) in the processing module Move track:
V (i)=0, i=1 (3)
V (i)=P (i)-P (i-1)+M (i), i >=2 (4)
Q (i)=P (i), i=1 (5)
Q (i)=Q (i-1)+V (i), i >=2 (6)
Wherein, V (i) is the displacement of the i-th frame in current animation deformation trace, and Q (i) is in current animation deformation trace The position of i-th frame.
As the improvement of said program, the position of each frame in the original animation deformation trace is the coordinate of two dimensional surface The coordinate points of point or three dimensions.
As the improvement of said program, the shift length of each frame in the original animation deformation trace be the frame with it is previous Air line distance between frame;The displacement difference is that the target point of former animation deformation trace is directed toward the mesh that current animation needs are moved to The displacement of punctuate.
The invention also discloses a kind of motion control methods of game object, including:
Current animation deformation trace is obtained by animation displacement drawing process as described above;
Game object movement is driven according to the current animation deformation trace.
The present invention also correspondence discloses a kind of motion control device of game object, including:
Animation displacement stretching device as described above, for obtaining current animation deformation trace;
Drive module drives game object movement according to the current animation deformation trace.
Compared with prior art, the movement control of animation displacement drawing process, device and game object disclosed by the invention Method, apparatus processed needs the displacement difference of the target point being moved to and the target point of former animation deformation trace, meter based on current animation The bit shift compensation for calculating each frame in former animation deformation trace makes the size of the bit shift compensation of each frame be proportional to the frame dynamic in original The shift length in deformation trace is drawn, and so that the bit shift compensation of all frames in former animation deformation trace is added and is equal to the displacement Then the bit shift compensation for each frame being calculated is added in the displacement for corresponding to frame in former animation deformation trace by difference, to Obtain current animation deformation trace.Due to current animation deformation trace can be according to each frame in former animation deformation trace displacement The ratio of length and the total displacement length of former animation deformation trace is allocated, and the displacement that each frame is compensated, and is proportional to Shift length of this frame in former animation deformation trace.In this way, it is possible to so that in entire animation displacement drawing process, often The bit shift compensation of one frame is sized to correspond to the movement speed of game object in original animation.Therefore, it is possible to make animation displacement Drawing process (current animation deformation trace) movement speed performance it is consistent with the performance of the movement speed of original animation, meet object for appreciation Family stretches the animation displacement expection of performance, solves and carrys out mobile object using animation displacement in gaming, when needing to move It is variant between the target point and the target point of original animation that arrive, when needing to carry out animation displacement stretched operation, using existing dynamic The method for drawing displacement Uniform Tension can not make the movement speed of the drawing process of animation displacement show the fortune for meeting original animation Dynamic speed performance does not meet the technical problem that player stretches the animation displacement expection of performance.
Description of the drawings
Fig. 1 is a kind of flow diagram of animation displacement drawing process in the embodiment of the present invention.
Fig. 2 is the schematic diagram of the former animation deformation trace and actual target point in Fig. 1.
Fig. 3 is that each frame of the former animation deformation trace of Fig. 2 is calculated using the animation displacement drawing process of Fig. 1 The schematic diagram of bit shift compensation.
Fig. 4 is when carrying out animation displacement to the former animation deformation trace of Fig. 2 using the animation displacement drawing process of Fig. 1 to stretch Process schematic.
Fig. 5 is after carrying out animation displacement stretching to the former animation deformation trace of Fig. 2 using the animation displacement drawing process of Fig. 1 Result schematic diagram.
Fig. 6 is to the former animation deformation trace of Fig. 2 using the method for the animation displacement Uniform Tension of the prior art into action Draw the result schematic diagram after displacement stretches.
Fig. 7 is a kind of structure diagram of animation displacement stretching device in the embodiment of the present invention.
Fig. 8 is a kind of flow diagram of the motion control method of game object in the embodiment of the present invention.
Fig. 9 is a kind of structure diagram of the motion control device of game object in the embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts Embodiment shall fall within the protection scope of the present invention.
It is a kind of flow diagram of animation displacement drawing process provided in an embodiment of the present invention referring to Fig. 1.The present embodiment It is to be directed to carry out mobile object using animation displacement in gaming, when current animation needs the target point (realistic objective being moved to Point) it is inconsistent with the target point of former animation deformation trace when, what when being stretched the case where, described, as shown in Figure 1, this hair A kind of animation displacement drawing process that bright embodiment provides includes step:
S101, the displacement difference that current animation needs the target point being moved to and the target point of former animation deformation trace is calculated;
Wherein, Fig. 2 is the input example of a former animation deformation trace, it is shown that each frame in former animation deformation trace The position for the game object that the moment fine arts make.It should be understood that the example of a plane is shown in Fig. 2, i.e. former animation position The position of each frame moved in track is coordinate points P (i)=(X of two dimensional surfacei,Yi).But in other embodiments, former dynamic The position for drawing each frame in deformation trace can also be coordinate points P (i)=(X of a three dimensionsi,Yi,Zi), not shadow Ring the implementation result of the present invention.
For the former animation with N frames, the position (coordinate points) of nth frame is the target point (seat of former animation deformation trace Punctuate).For example, in fig. 2, former animation includes 6 frames, then the position P (6) of the 6th frame is the target point of former animation deformation trace.
Assuming that the position of the last frame for the cartoon track that the fine arts make is P (N), but reality is wished object displacement to D Locate (shown in such as Fig. 2), then there are a displacement difference (D-P (N)) (vectors) between them.Wherein, the displacement difference D-P (N) it is that the target point of former animation deformation trace is directed toward the displacement for the target point that current animation needs are moved to.It should be understood that by Needing the target point being moved in current animation, there may be remote or close (the opposite startings of the target point than former animation deformation trace Point) two kinds of situations, therefore, the direction of displacement difference D-P (N) may be positive direction or negative direction (opposite starting point).
S102, the bit shift compensation for calculating each frame in former animation deformation trace, make the size of the bit shift compensation of each frame It is proportional to shift length of the frame in former animation deformation trace, and makes the bit shift compensation of all frames in former animation deformation trace It is added and is equal to the displacement difference;
Wherein, the method for specifically calculating bit shift compensation is as follows:
Assuming that the position of the last frame for the cartoon track that the fine arts make is P (N), but reality is wished object displacement to D Locate (shown in such as Fig. 2), then there are a displacement difference D-P (N) between them, then we need in each frame according to this position It is poor to move, and contraposition is moved and compensated.The mode of bit shift compensation is so that the size of the bit shift compensation of each frame is proportional to this frame and exists Shift length (scalar) in former animation deformation trace, and make the bit shift compensation addition of all frames etc. in former animation deformation trace In the displacement difference (direction of the bit shift compensation of all frames is consistent with the direction of the displacement difference).
Specifically, calculating the bit shift compensation of each frame in former animation deformation trace by following formula (1)~(2):
M (i)=0, i=1 (1)
M (i)=(D-P (N)) * | P (i)-P (i-1) |/S, i >=2 (2)
Wherein, M (i) is the bit shift compensation of the i-th frame in former animation deformation trace, and P (i) is in former animation deformation trace The position of i-th frame, P (N) are the target point of former animation deformation trace, and D is the target point that current animation needs are moved to, and S is original The total displacement length (scalar) of animation deformation trace.
Wherein, (1)=0 M indicates that the start frame in former animation deformation trace need not carry out bit shift compensation, and follow-up The bit shift compensation M (i) of each frame (for example, i-th frame) is proportional to the shift length from i-1 frames to i frames.In addition,
Wherein, current animation needs the displacement difference (D-P of the target point being moved to and the target point of former animation deformation trace (N)) S101 is obtained through the above steps.
For the former animation with N frames (N >=2), calculating the specific method of the total displacement length of former animation deformation trace is:
S=| P (2)-P (1) |+| P (3)-P (2) |+...+| P (N)-P (N-1) |
Wherein, S is the total displacement length of former animation deformation trace, and P (i) is the position of the i-th frame in former animation deformation trace It sets (coordinate points), P (N) is the position (coordinate points) of the last frame of former animation deformation trace, i.e., the mesh of former animation deformation trace Punctuate.| P (i)-P (i-1) | for shift length of the i-th frame in former animation deformation trace in former animation deformation trace, i.e., i-th Air line distance between the position of frame and the position of the (i-1)-th frame, wherein 1≤i≤N.
Therefore, the position (coordinate points) based on each frame given in former animation deformation trace, can calculate former animation Shift length of each frame in former animation deformation trace in the total displacement length of deformation trace and former animation deformation trace, To which the bit shift compensation of each frame in former animation deformation trace be calculated according to above-mentioned formula (1)~(2).For example, Fig. 3 is aobvious The bit shift compensation based on each frame in the obtained former animation deformation traces of Fig. 2 is shown.
In addition, according to formula (1)~(2) it is found that since displacement difference (D-P (N)) is a vector, bit shift compensation M (i) For a vector, and direction is identical as the direction of displacement difference (D-P (N)).
S103, the bit shift compensation for each frame being calculated, which is added to, corresponds to the displacement of frame in former animation deformation trace On, to obtain current animation deformation trace.
Current animation deformation trace is calculated by following formula (3)~(6):
V (i)=0, i=1 (3)
V (i)=P (i)-P (i-1)+M (i), i >=2 (4)
Q (i)=P (i), i=1 (5)
Q (i)=Q (i-1)+V (i), i >=2 (6)
Wherein, V (i) is that (namely the i-th frame is with respect to the position of the (i-1)-th frame for the displacement of the i-th frame in current animation deformation trace Move), Q (i) is the position of the i-th frame in current animation deformation trace.
Specifically, in former animation deformation trace, since the start frame in former animation deformation trace need not carry out displacement Compensation, therefore, after carrying out bit shift compensation, V (1)=0.It is follow-up each in addition to start frame in former animation deformation trace The displacement for the object that frame (for example, i-th frame) is generated relative to the (i-1)-th frame is V (i)=P (i)-P (i-1), then carries out bit shift compensation Later, the i-th frame becomes V (i)=P (i)-P (i-1)+M (i) relative to the displacement of the object of the (i-1)-th frame.It should be understood that due to The i-th frame in former animation deformation trace is that tool is directive relative to the displacement of the (i-1)-th frame, and M (i) is also the displacement with direction Compensation, therefore, V (i) are also a vector.As shown in Figure 4.
It is after the displacement of each frame in obtaining current animation deformation trace, i.e., each in current animation deformation trace The new position Q (i) of frame becomes:
Q (1)=P (1), i.e. initial position is constant;
Q (i)=Q (i-1)+V (i), i.e., the follow-up position per frame are on the basis of previous frame position plus between this two frame Displacement V (i), wherein displacement have done bit shift compensation.
In this way, the position Q (i) of each frame of current animation deformation trace is calculated by formula (3)~(6), successively The position Q (i) for connecting each frame forms current animation deformation trace.
Fig. 5 is shown after step S103, is obtained object and is animated the actual motion track after displacement stretches.
In the embodiment of the present invention, in the target point of current animation actual needs mobile target point and former animation deformation trace Between when have differences, the displacement difference between this two target points can be shared on each frame of animation, and point The mode at booth is so that the size of the bit shift compensation of each frame is all proportional to the shift length of this frame in former animation, Er Qiesuo Some bit shift compensations are added, i.e. and M (1)+M (2)+...+M (N)=D-P (N), i.e., total bit shift compensation are exactly equal to two target points Between displacement difference, therefore carry out in the way of in step S103 driven object movement, just can be in last frame by object It is moved at target point D, achievees the purpose that animation displacement is stretched to target point.Obviously the animation displacement of each frame stretches table simultaneously It is now consistent with the performance of the speed of original animation, i.e., inside former animation deformation trace, if a certain section of time shifting is compared Few, then the stretching of this period is also fewer.Fig. 5 shows this result, it can be seen that in inside former animation deformation trace Between a section move it is fewer, it is corresponding stretching track inside change in displacement (i.e. bit shift compensation) it is also fewer, in this way Allowing for entire drawing process has certain semanteme, meets the expectation that player shows this animation.As a comparison, Fig. 6 is aobvious Show and animation displacement stretching is carried out to the former animation deformation trace of Fig. 2 using the method for the animation displacement Uniform Tension of the prior art Result schematic diagram afterwards, Fig. 6 is using the animation displacement stretching mode for temporally uniformly sharing displacement difference, i.e., the displacement of each frame Compensation is equal to (D-P (N))/(N-1) (first frame needs not compensate for, subsequent all uniformly to share displacement difference).It can be seen that It can not accomplish the adaptivity that animation displacement stretches in this way, it is bigger in intermediate displacement fewer stage and other displacements Stage does not have difference on bit shift compensation, inconsistent with the rhythm of original animation deformation trace faster or slower.
Fig. 7 is a kind of structure diagram of animation displacement stretching device in the embodiment of the present invention.As shown in fig. 7, the animation position Moving stretching device 70 includes:
Displacement difference computing module 701 needs the target point being moved to and former animation deformation trace for calculating current animation Target point displacement difference;
Bit shift compensation computing module 702, the bit shift compensation for calculating each frame in former animation deformation trace, makes each The size of the bit shift compensation of frame is proportional to shift length of the frame in former animation deformation trace, and makes in former animation deformation trace All frames bit shift compensation be added be equal to the displacement difference;
Processing module 703 is right in former animation deformation trace for the bit shift compensation for each frame being calculated to be added to It answers in the displacement of frame, to obtain current animation deformation trace.
Wherein, the bit shift compensation computing module 702 is calculated by following formula (1)~(2) in former animation deformation trace Each frame bit shift compensation:
M (i)=0, i=1 (1)
M (i)=(D-P (N)) * | P (i)-P (i-1) |/S, i >=2 (2)
Wherein, M (i) is the bit shift compensation of the i-th frame in former animation deformation trace, and P (i) is in former animation deformation trace The position of each frame, P (N) are the target point of former animation deformation trace, and D is the target point that current animation needs are moved to, and S is original The total displacement length of animation deformation trace.
And current animation deformation trace is calculated by following formula (3)~(6) in the processing module 703:
V (i)=0, i=1 (3)
V (i)=P (i)-P (i-1)+M (i), i >=2 (4)
Q (i)=P (i), i=1 (5)
Q (i)=Q (i-1)+V (i), i >=2 (6)
Wherein, V (i) is the displacement of the i-th frame in current animation deformation trace, and Q (i) is in current animation deformation trace The position of i-th frame.
The specific work process of the animation displacement stretching device 70 of the present embodiment can refer to the animation displacement of above-described embodiment Drawing process, in this not go into detail.
Fig. 8 is a kind of flow diagram of the motion control method of game object in the embodiment of the present invention.The present embodiment is It is directed to and carrys out mobile object using animation displacement in gaming, when current animation needs the target point (actual target point) being moved to When inconsistent with the target point of former animation deformation trace, need to obtain new movement locus by stretching mode to drive game Object, the method comprising the steps of:
S801, current animation deformation trace is obtained by animation displacement drawing process shown in FIG. 1;
S802, game object movement is driven according to the current animation deformation trace.
Wherein, the work realization process of step S801 please refers to the animation displacement drawing process of above-described embodiment, is passing through After step S801 obtains current animation deformation trace, game object movement can be driven according to the current animation deformation trace, In, the common technology of the art can be used in type of drive, and details are not described herein.
Fig. 9 is a kind of structure diagram of the motion control device of game object in the embodiment of the present invention.The motion control fills It sets including animation displacement stretching device 70 and drive module 80, wherein concrete structure such as Fig. 7 of the animation displacement stretching device It is shown, for obtaining current animation deformation trace.And the drive module 80 drives according to the current animation deformation trace and swims Object of playing moves.
In conclusion animation displacement drawing process disclosed by the invention, device and game object motion control method, Device needs the target point being moved to calculate former animation with the displacement difference of the target point of former animation deformation trace based on current animation The bit shift compensation of each frame in deformation trace makes the size of the bit shift compensation of each frame be proportional to the frame in former animation displacement rail Shift length in mark, and so that the bit shift compensation of all frames in former animation deformation trace is added and be equal to the displacement difference, then The bit shift compensation for each frame being calculated is added in the displacement for corresponding to frame in former animation deformation trace, it is current to obtain Animation deformation trace.Since current animation deformation trace can be according to shift length of each frame in former animation deformation trace and original The ratio of the total displacement length of animation deformation trace is allocated, and the displacement that each frame is compensated, and is proportional to this frame and is existed Shift length in former animation deformation trace.In this way, it is possible to so that in entire animation displacement drawing process, the position of each frame Compensation is moved to be sized to correspond to the movement speed of object in original animation.Therefore, it is possible to make animation displacement drawing process (when Preceding animation deformation trace) movement speed performance it is consistent with the performance of the movement speed of original animation, meet player to the animation position Move the expection for stretching performance, solve and carry out mobile object using animation displacement in gaming, when need the target point that is moved to and It is originally variant between the target point of animation, when needing to carry out animation displacement stretched operation, uniformly drawn using existing animation displacement The method stretched can not make the movement speed of the drawing process of animation displacement show the movement speed performance for meeting original animation, no Meet the technical problem that player stretches the animation displacement expection of performance.
The above is the preferred embodiment of the present invention, it is noted that for those skilled in the art For, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also considered as Protection scope of the present invention.

Claims (12)

1. a kind of animation displacement drawing process, which is characterized in that including:
Calculate the displacement difference that current animation needs the target point being moved to and the target point of former animation deformation trace;
The bit shift compensation for calculating each frame in former animation deformation trace, makes the size of the bit shift compensation of each frame be proportional to the frame Shift length in former animation deformation trace, and so that the bit shift compensation of all frames in former animation deformation trace is added and be equal to institute State displacement difference;
The bit shift compensation for each frame being calculated is added in the displacement for corresponding to frame in former animation deformation trace, to obtain Current animation deformation trace.
2. animation displacement drawing process as described in claim 1, which is characterized in that calculated by following formula (1)~(2) former The bit shift compensation of each frame in animation deformation trace:
M (i)=0, i=1 (1)
M (i)=(D-P (N)) * | P (i)-P (i-1) |/S, i >=2 (2)
Wherein, M (i) is the bit shift compensation of the i-th frame in former animation deformation trace, and P (i) is i-th in former animation deformation trace The position of frame, P (N) are the target point of former animation deformation trace, and D is the target point that current animation needs are moved to, and S is former animation The total displacement length of deformation trace.
3. animation displacement drawing process as claimed in claim 2, which is characterized in that calculated by following formula (3)~(6) To current animation deformation trace:
V (i)=0, i=1 (3)
V (i)=P (i)-P (i-1)+M (i), i >=2 (4)
Q (i)=P (i), i=1 (5)
Q (i)=Q (i-1)+V (i), i >=2 (6)
Wherein, V (i) is the displacement of the i-th frame in current animation deformation trace, and Q (i) is i-th in current animation deformation trace The position of frame.
4. animation displacement drawing process as described in claim 1, which is characterized in that each in the original animation deformation trace The position of frame is the coordinate points of two dimensional surface or the coordinate points of three dimensions.
5. animation displacement drawing process as described in claim 1, which is characterized in that each in the original animation deformation trace Air line distance of the shift length of frame between the frame and former frame;The displacement difference is that the target point of former animation deformation trace refers to The displacement for the target point for needing to be moved to current animation.
6. a kind of animation displacement stretching device, which is characterized in that including:
Displacement difference computing module needs the target point of the target point being moved to and former animation deformation trace for calculating current animation Displacement difference;
Bit shift compensation computing module, the bit shift compensation for calculating each frame in former animation deformation trace, makes the position of each frame The size for moving compensation is proportional to shift length of the frame in former animation deformation trace, and makes all in former animation deformation trace The bit shift compensation of frame, which is added, is equal to the displacement difference;
Processing module corresponds to the position of frame for the bit shift compensation for each frame being calculated to be added in former animation deformation trace In shifting, to obtain current animation deformation trace.
7. animation displacement stretching device as claimed in claim 6, which is characterized in that the bit shift compensation computing module by with Lower formula (1)~(2) calculate the bit shift compensation of each frame in former animation deformation trace:
M (i)=0, i=1 (1)
M (i)=(D-P (N)) * | P (i)-P (i-1) |/S, i >=2 (2)
Wherein, M (i) is the bit shift compensation of the i-th frame in former animation deformation trace, and P (i) is each in former animation deformation trace The position of frame, P (N) are the target point of former animation deformation trace, and D is the target point that current animation needs are moved to, and S is former animation The total displacement length of deformation trace.
8. animation displacement stretching device as claimed in claim 7, which is characterized in that the processing module passes through following formula (3) current animation deformation trace is calculated in~(6):
V (i)=0, i=1 (3)
V (i)=P (i)-P (i-1)+M (i), i >=2 (4)
Q (i)=P (i), i=1 (5)
Q (i)=Q (i-1)+V (i), i >=2 (6)
Wherein, V (i) is the displacement of the i-th frame in current animation deformation trace, and Q (i) is i-th in current animation deformation trace The position of frame.
9. animation displacement stretching device as claimed in claim 6, which is characterized in that each in the original animation deformation trace The position of frame is the coordinate points of two dimensional surface or the coordinate points of three dimensions.
10. animation displacement stretching device as claimed in claim 6, which is characterized in that every in the original animation deformation trace Air line distance of the shift length of one frame between the frame and former frame;The displacement difference is the target point of former animation deformation trace It is directed toward the displacement that current animation needs the target point being moved to.
11. a kind of motion control method of game object, which is characterized in that including:
Current animation deformation trace is obtained by the animation displacement drawing process as described in Claims 1 to 5;
Game object movement is driven according to the current animation deformation trace.
12. a kind of motion control device of game object, which is characterized in that including:
Such as claim 6~10 any one of them animation displacement stretching device, for obtaining current animation deformation trace;
Drive module drives game object movement according to the current animation deformation trace.
CN201510594717.8A 2015-09-17 2015-09-17 Animation displacement drawing process, device and motion control method, device Active CN105118079B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510594717.8A CN105118079B (en) 2015-09-17 2015-09-17 Animation displacement drawing process, device and motion control method, device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510594717.8A CN105118079B (en) 2015-09-17 2015-09-17 Animation displacement drawing process, device and motion control method, device

Publications (2)

Publication Number Publication Date
CN105118079A CN105118079A (en) 2015-12-02
CN105118079B true CN105118079B (en) 2018-08-07

Family

ID=54666052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510594717.8A Active CN105118079B (en) 2015-09-17 2015-09-17 Animation displacement drawing process, device and motion control method, device

Country Status (1)

Country Link
CN (1) CN105118079B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105551072B (en) * 2015-12-11 2018-11-30 网易(杭州)网络有限公司 Realize the method and system of actor model part real time kinematics
CN107577398B (en) * 2017-08-08 2021-03-12 深圳Tcl新技术有限公司 Interface animation control method, equipment and storage medium
CN111744196B (en) * 2020-07-03 2024-02-23 珠海西山居数字科技有限公司 Task target guiding method and device in game task

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6373492B1 (en) * 1995-12-26 2002-04-16 Imax Corporation Computer-assisted animation construction system and method and user interface
CN103634590A (en) * 2013-11-08 2014-03-12 上海风格信息技术股份有限公司 Method for detecting rectangular deformation and pixel displacement of video based on DCT (Discrete Cosine Transform)
CN103729865A (en) * 2012-10-16 2014-04-16 北京千橡网景科技发展有限公司 Method and device for stretching images
CN104142820A (en) * 2014-02-12 2014-11-12 腾讯科技(深圳)有限公司 Animation production method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6373492B1 (en) * 1995-12-26 2002-04-16 Imax Corporation Computer-assisted animation construction system and method and user interface
CN103729865A (en) * 2012-10-16 2014-04-16 北京千橡网景科技发展有限公司 Method and device for stretching images
CN103634590A (en) * 2013-11-08 2014-03-12 上海风格信息技术股份有限公司 Method for detecting rectangular deformation and pixel displacement of video based on DCT (Discrete Cosine Transform)
CN104142820A (en) * 2014-02-12 2014-11-12 腾讯科技(深圳)有限公司 Animation production method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
平面影像的运动透视表现;刘成锁;《音画工坊》;20080915(第09期);51-52 *

Also Published As

Publication number Publication date
CN105118079A (en) 2015-12-02

Similar Documents

Publication Publication Date Title
CN105118079B (en) Animation displacement drawing process, device and motion control method, device
Kober et al. Movement templates for learning of hitting and batting
CN106003033B (en) A kind of sixdegree-of-freedom simulation standard Chinese character Writing method with power control
CN108876815B (en) Skeleton posture calculation method, character virtual model driving method and storage medium
CN105551072B (en) Realize the method and system of actor model part real time kinematics
CN108890644B (en) Multi-axis synchronous trajectory planning method and system and computer readable storage medium
CN106950923B (en) A kind of speed planning method for determining interpolation cycle
CN103870665A (en) Method for three-dimensional dynamic simulation in space manipulator auxiliary butt-joint process
CN102708582A (en) Character movement redirecting method for heterogeneous topology
CN101515373B (en) Sports interactive animation producing method
CN106178504A (en) Virtual objects motion control method and device
CN101878488A (en) Method to animate on a computer screen a virtual pen which writes and draws
CN105976416A (en) Lens animation generating method and system
CN109605377A (en) A kind of joint of robot motion control method and system based on intensified learning
CN105938364A (en) Calculation method of kinetic model of 3D under-actuated biped robot
CN104651909B (en) Synchronous coordinated control method of series-parallel automobile electrophoretic painting conveying mechanism
Vultur et al. Real-time gestural interface for navigation in virtual environment
CN104835195A (en) Hierarchical skeleton model for virtual body posture control
CN110355753A (en) Robot controller, robot control method and storage medium
CN1916969A (en) Method for generating reaction accompany movement based on hybrid control
CN104616338A (en) Two-dimensional animation-based time-space consistent variable speed interpolation method
CN1794081A (en) Control method of object motion in filmslide
Peng et al. Dualmotion: Global-to-local casual motion design for character animations
CN101952879A (en) Methods and apparatus for designing animatronics units from articulated computer generated characters
CN106126059B (en) Animated button device and display methods based on parameter

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant