CN105118079A - Method and device for stretching displacement of animation, and motion control method and device - Google Patents

Method and device for stretching displacement of animation, and motion control method and device Download PDF

Info

Publication number
CN105118079A
CN105118079A CN201510594717.8A CN201510594717A CN105118079A CN 105118079 A CN105118079 A CN 105118079A CN 201510594717 A CN201510594717 A CN 201510594717A CN 105118079 A CN105118079 A CN 105118079A
Authority
CN
China
Prior art keywords
animation
displacement
frame
deformation trace
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.)
Granted
Application number
CN201510594717.8A
Other languages
Chinese (zh)
Other versions
CN105118079B (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 method for stretching the displacement of an animation. The method comprises steps of: computing a displacement difference between a target point where a current animation is required to be moved and a target point of an original animation displacement locus; computing the displacement compensation of each frame in the original animation displacement locus in order that the displacement compensation of each frame is in direct proportion to the displacement length of the corresponding frame in the original animation displacement locus and that the sum of the displacement compensations of all frames in the original animation displacement locus is equal to the displacement difference; and superposing the computed displacement compensation of each frame onto the displacement of the corresponding frame in the original animation displacement locus so as to obtain the displacement locus of the current animation. The method for stretching the displacement of the animation enables the displacement stretching speed of the animation is consistent with that of an original made animation, and enables the motion of an object to be more consistent with the expectation of a player. The embodiment of the invention also discloses a device for stretching the displacement of an animation, and a method and device for controlling the motion of a game object.

Description

Animation displacement drawing process, device and motion control method, device
Technical field
The present invention relates to game object control field, particularly relate to motion control method, the device of a kind of animation displacement drawing process, device and game object.
Background technology
The mode of the athletic performance of control object common in game often has the following two kinds:
A kind of mode of control object athletic performance is: the fine arts make the skeleton cartoon in an original place, then in programmed logic, control object moves, the walking performance of such as personage, the skeleton cartoon of walking in an original place can be made by the fine arts, then allow personage move by certain speed in program code logic, reach the expression effect that personage is walking.This mode is suitable for the situation that object motion speed is comparatively fixed, and such as walks, runs, but if movement velocity, track comparatively complicated situation, is just not easy to go to realize with programmed logic.
The mode of another control object athletic performance uses animation displacement.In this manner, what the fine arts made is not an original place animation but a skeleton cartoon with displacement, when then playing this animation in gaming, mobile object will be carried out according to the deformation trace of this animation, the advantage of this mode is that object performance in gaming can consistent with artistic design, the complexity on speed, track can be had to change, strengthen the expressive force of game object.Therefore, on the athletic movement of this mode through being usually used in game object, the technical ability (there is certain speed rhythm change centre) that such as in game, personage splits toward front jumping, shows the movement of personage in this way, will be more natural.But use in animation displacement in reality, a problem that often can run into is, the fine arts have made one section of animation deformation trace can move to certain impact point relative with current location, but planning wishes that this object finally moves to another impact point.Still split technical ability for the jumping of personage, the deformation trace that the fine arts may make jumps to forward 3 meters of, but in reality, the target of attack of personage is at 5 meters of above, if so still move personage according to original deformation trace, just cannot attack target.In this case, just need the impact point according to reality, the deformation trace of animation is stretched, is stretched to 5 meters from 3 meters, Here it is so-called animation displacement stretching technique.Here " stretching " is not limited to elongation, is also likely to shorten, and such as actual target point is from the closer situation of object.
The basic ideas of the animation drawing process of current game engine are on the market, displacement difference between the impact point of the impact point that calculating is actual and the deformation trace that the fine arts make, then by the working time of this displacement difference divided by animation, obtain a speed, then in animation playing process, this speed is added to it object, as a compensation speed, like this after animation finishes, corresponding object just has a bit shift compensation, equal that displacement difference, so just can ensure that last object can be displaced to the impact point of specifying.
Summary of the invention
Find through engineering test research, although the animation drawing process scheme of the game engine of prior art realizes simple, it is according to time indiscriminate Uniform Tension in essence, and drawing effect is stiff, cannot meet embody rule under particular surroundings.Particularly: in gaming, we wish that the process stretched can be consistent with the rhythm of original animation itself, such as still split technical ability to jump, if jump split technical ability in centre for some time personage be that stagnant sky is motionless, so we also wish do not stretching during this period of time, if jumping personage when splitting end moves than comparatively fast, we also wish that the speed that stretches during this period of time can than comparatively fast.If the motion created because of stretching in stagnant null process, obviously this is exactly phenomenologically not too meet expection.
Technical ability is split for above-mentioned jumping, centre is split when having one section of stagnant sky motionless if jumped, then this animation displacement Uniform Tension method conventionally, get on still having a translational speed superposition during this period of time, not too will meet the expection that player shows this technical ability like this.Therefore, animation displacement is used to carry out mobile object in gaming, variant when between the impact point needing the impact point that moves to and original animation, when needing to carry out animation displacement stretched operation, adopt the method for existing animation displacement Uniform Tension that the performance of the motion speed of the drawing process of animation displacement can not be made to meet the motion speed performance of original animation, do not meet the expection of player to this animation displacement stretching performance.
For realizing the animation drawing effect of more high-quality, we have proposed a kind of desirable animation displacement and stretch, it is have certain Semantic that desirable animation displacement stretches, and stretches soon corresponding when the motion in original cartoon track is fast, stretches also slowly corresponding when moving slow.
Stretch for realizing above-mentioned desirable animation displacement, the invention provides a kind of animation displacement drawing process and device, the speed speed performance that animation displacement can be made to stretch shows consistent with the animation displacement speed that the original fine arts make, and allows the athletic performance of object more meet the expection of player.
Embodiments provide a kind of animation displacement drawing process, comprising:
Calculate the displacement difference that current animation needs the impact point of impact point and the former animation deformation trace moved to;
Calculate the bit shift compensation of each frame in former animation deformation trace, make the size of the bit shift compensation of each frame be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference;
The bit shift compensation of each frame calculated is added in the displacement of corresponding frame in former animation deformation trace, thus obtains current animation deformation trace.
As the improvement of such scheme, calculated 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, P (i) is the position of each frame in former animation deformation trace, P (N) is the impact point of former animation deformation trace, D is the impact point that current animation needs to move to, and S is the total displacement length of former animation deformation trace.
As the improvement of such scheme, calculate current animation deformation trace 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 the position of the i-th frame in current animation deformation trace.
As the improvement of such scheme, the position of each frame in described former animation deformation trace is the coordinate points of two dimensional surface or three-dimensional coordinate points.
As the improvement of such scheme, the shift length of each frame in described former animation deformation trace is the air line distance between this frame and former frame; Described displacement difference is that the impact point of former animation deformation trace points to current animation and needs the displacement of the impact point moved to.
Embodiment of the present invention correspondence provides a kind of animation displacement stretching device, comprising:
Displacement difference computing module, for calculating the displacement difference of the impact point of impact point that current animation needs to move to and former animation deformation trace;
Bit shift compensation computing module, for calculating the bit shift compensation of each frame in former animation deformation trace, make the size of the bit shift compensation of each frame be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference;
Processing module, the displacement of corresponding frame in former animation deformation trace that the bit shift compensation of each frame calculated is added to, thus obtain current animation deformation trace.
As the improvement of such scheme, described bit shift compensation computing module calculates 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, P (i) is the position of each frame in former animation deformation trace, P (N) is the impact point of former animation deformation trace, D is the impact point that current animation needs to move to, and S is the total displacement length of former animation deformation trace.
As the improvement of such scheme, described processing module calculates current animation deformation trace 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 the position of the i-th frame in current animation deformation trace.
As the improvement of such scheme, the position of each frame in described former animation deformation trace is the coordinate points of two dimensional surface or three-dimensional coordinate points.
As the improvement of such scheme, the shift length of each frame in described former animation deformation trace is the air line distance between this frame and former frame; Described displacement difference is that the impact point of former animation deformation trace points to current animation and needs the displacement of the impact point moved to.
The invention also discloses a kind of motion control method of game object, comprising:
Current animation deformation trace is obtained by animation displacement drawing process as above;
Game object motion is driven according to described current animation deformation trace.
The present invention is the corresponding motion control device disclosing a kind of game object also, comprising:
Animation displacement stretching device as above, for obtaining current animation deformation trace;
Driver module, drives game object motion according to described current animation deformation trace.
Compared with prior art, animation displacement drawing process disclosed by the invention, the motion control method of device and game object, device needs the displacement difference of the impact point of impact point and the former animation deformation trace moved to based on current animation, calculate the bit shift compensation of each frame in former animation deformation trace, the size of the bit shift compensation of each frame is made to be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference, then the bit shift compensation of each frame calculated is added in the displacement of corresponding frame in former animation deformation trace, thus obtain current animation deformation trace.Because current animation deformation trace can distribute according to the ratio of the total displacement length of the shift length of each frame in former animation deformation trace and former animation deformation trace; and the displacement that each frame compensates, be proportional to the shift length of this frame in former animation deformation trace.Like this, just can make in whole animation displacement drawing process, the bit shift compensation size of each frame can correspond to the motion speed of game object in original animation.Therefore, the motion speed of the drawing process of animation displacement (current animation deformation trace) can be made to show consistent with the motion speed performance of original animation, meet the expection of player to this animation displacement stretching performance, solve and use animation displacement to carry out mobile object in gaming, variant when between the impact point needing the impact point that moves to and original animation, when needing to carry out animation displacement stretched operation, adopt the method for existing animation displacement Uniform Tension that the performance of the motion speed of the drawing process of animation displacement can not be made to meet the motion speed performance of original animation, do not meet the technical matters of player to the expection of this animation displacement stretching performance.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of a kind of animation displacement drawing process in the embodiment of the present invention.
Fig. 2 is the schematic diagram of a former animation deformation trace in Fig. 1 and actual target point.
Fig. 3 is the schematic diagram of the bit shift compensation utilizing the animation displacement drawing process of Fig. 1 each frame to the former animation deformation trace of Fig. 2 to calculate.
Fig. 4 be utilize the former animation deformation trace of the animation displacement drawing process of Fig. 1 to Fig. 2 carry out animation displacement stretch time process schematic.
Fig. 5 utilizes the former animation deformation trace of the animation displacement drawing process of Fig. 1 to Fig. 2 to carry out the result schematic diagram after animation displacement stretching.
Fig. 6 utilizes the former animation deformation trace of the method for the animation displacement Uniform Tension of prior art to Fig. 2 to carry out the result schematic diagram after animation displacement stretching.
Fig. 7 is the structured flowchart of a kind of animation displacement stretching device in the embodiment of the present invention.
Fig. 8 is the schematic flow sheet of the motion control method of a kind of game object in the embodiment of the present invention.
Fig. 9 is the structured flowchart of the motion control device of a kind of game object in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 1, it is the schematic flow sheet of a kind of animation displacement drawing process that the embodiment of the present invention provides.The present embodiment is aimed at and uses animation displacement to carry out mobile object in gaming, when current animation needs the impact point of impact point (actual target point) and the former animation deformation trace moved to inconsistent, situation when stretching is needed to describe, as shown in Figure 1, a kind of animation displacement drawing process that the embodiment of the present invention provides comprises step:
S101, calculating current animation need the displacement difference of the impact point of impact point and the former animation deformation trace moved to;
Wherein, Fig. 2 is the input example of a former animation deformation trace, shows the position of the game object that each the frame moment fine arts in former animation deformation trace make.Understandable, Fig. 2 display be the example of a plane, the position of each frame namely in former animation deformation trace is coordinate points P (i)=(X of two dimensional surface i, Y i).But in other embodiments, the position of each frame in former animation deformation trace also can be three-dimensional coordinate points P (i)=(X i, Y i, Z i), do not affect implementation result of the present invention.
For the former animation with N frame, the position (coordinate points) of N frame is the impact point (coordinate points) of former animation deformation trace.Such as, in fig. 2, former animation comprises 6 frames, then the position P (6) of the 6th frame impact point that is former animation deformation trace.
Suppose that the position of the last frame of the cartoon track that the fine arts make is P (N), but to D place (as shown in Fig. 2), then be there is a displacement difference (D-P (N)) (vector) between them by actual hope in object displacement.Wherein, the impact point that described displacement difference D-P (N) is former animation deformation trace points to the displacement that current animation needs the impact point moved to.Understandable, because current animation needs the impact point moved to may there are far away than the impact point of former animation deformation trace or nearly (relative starting point) two kinds of situations, therefore, the direction of displacement difference D-P (N) may be positive dirction or opposite direction (relative starting point).
When the position of each frame in former animation deformation trace is the coordinate points of two dimensional surface, if P (N)=(X n, Y n), D=(X d, Y d), so, described displacement extent is: | D - P ( N ) | = ( X N - X D ) 2 + ( Y N - Y D ) 2 , The direction of described displacement difference is the direction that the impact point of former animation deformation trace points to current animation and needs the impact point moved to;
When the position of each frame in former animation deformation trace is three-dimensional coordinate points, if P (N)=(X n, Y n, Z n), D=(X d, Y d, Z d), so, the size of the shift length of the i-th frame in former animation deformation trace in former animation deformation trace is: | D - P ( N ) | = ( X N - X D ) 2 + ( Y N - Y D ) 2 + ( Z N - Z D ) 2 , The direction of described displacement difference is the direction that the impact point of former animation deformation trace points to current animation and needs the impact point moved to.
S102, calculate the bit shift compensation of each frame in former animation deformation trace, make the size of the bit shift compensation of each frame be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference;
Wherein, the method for concrete displacement calculating compensation is as follows:
Suppose that the position of the last frame of the cartoon track that the fine arts make is P (N), but reality is wished object displacement to D place (as shown in Fig. 2), then there is a displacement difference D-P (N) between them, then we need at each frame according to this displacement difference, and contraposition moves and compensates.The mode of bit shift compensation makes the size of the bit shift compensation of each frame be proportional to the shift length (scalar) of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference (direction of the bit shift compensation of all frames is consistent with the direction of described displacement difference).
Concrete, the bit shift compensation of each frame in former animation deformation trace is calculated 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, P (i) is the position of the i-th frame in former animation deformation trace, P (N) is the impact point of former animation deformation trace, D is the impact point that current animation needs to move to, and S is the total displacement length (scalar) of former animation deformation trace.
Wherein, M (1)=0, namely represent that the start frame in former animation deformation trace does not need to carry out bit shift compensation, and bit shift compensation M (i) of each frame follow-up (such as, the i-th frame) is proportional to the shift length from i-1 frame to i frame.In addition,
Wherein, current animation needs the displacement difference (D-P (N)) of the impact point of impact point and the former animation deformation trace moved to be obtained by above-mentioned steps S101.
For the former animation with N frame (N >=2), the concrete grammar calculating 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, the position (coordinate points) that P (i) is the i-th frame in former animation deformation trace, the position (coordinate points) that P (N) is the last frame of former animation deformation trace, the i.e. impact point of former animation deformation trace.| P (i)-P (i-1) | be the shift length of the i-th frame in former animation deformation trace in former animation deformation trace, the air line distance namely between the position of the i-th frame and the position of the i-th-1 frame, wherein, 1≤i≤N.
When the position of each frame in former animation deformation trace is the coordinate points of two dimensional surface, if P (i-1)=(X i-1, Y i-1), P (i)=(X i, Y i), so, the shift length of the i-th frame in former animation deformation trace in former animation deformation trace is: | P ( i ) - P ( i - 1 ) | = ( X i - X i - 1 ) 2 + ( Y i - Y i - 1 ) 2 ;
When the position of each frame in former animation deformation trace is three-dimensional coordinate points, if P (i-1)=(X i-1, Y i-1, Z i-1), P (i)=(X i, Y i, Z i), so, the shift length of the i-th frame in former animation deformation trace in former animation deformation trace is: | P ( i ) - P ( i - 1 ) | = ( X i - X i - 1 ) 2 + ( Y i - Y i - 1 ) 2 + ( Z i - Z i - 1 ) 2 .
Therefore, based on the position (coordinate points) of each frame given in former animation deformation trace, the shift length of each frame in former animation deformation trace in the total displacement length of former animation deformation trace and former animation deformation trace can be calculated, thus calculate the bit shift compensation of each frame in former animation deformation trace according to above-mentioned formula (1) ~ (2).Such as, Fig. 3 shows the bit shift compensation of each frame in the former animation deformation trace obtained based on Fig. 2.
In addition, known according to formula (1) ~ (2), because displacement difference (D-P (N)) is a vector, bit shift compensation M (i) is also a vector, and direction is identical with the direction of displacement difference (D-P (N)).
In S103, former animation deformation trace that the bit shift compensation of each frame calculated is added to corresponding frame displacement on, thus 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, the displacement (being also the displacement of relative i-th-1 frame of the i-th frame) that V (i) is the i-th frame in current animation deformation trace, Q (i) is the position of the i-th frame in current animation deformation trace.
Concrete, in former animation deformation trace, because the start frame in former animation deformation trace does not need to carry out bit shift compensation, therefore, after carrying out bit shift compensation, V (1)=0.In former animation deformation trace, each frame follow-up except start frame (such as, i-th frame) displacement of object that produces relative to the i-th-1 frame is V (i)=P (i)-P (i-1), after then carrying out bit shift compensation, the i-th frame becomes V (i)=P (i)-P (i-1)+M (i) relative to the displacement of the object of the i-th-1 frame.Understandable, because the i-th frame in former animation deformation trace is that tool is directive relative to the displacement of the i-th-1 frame, M (i) is also the bit shift compensation in band direction, and therefore, V (i) is also a vector.As shown in Figure 4.
After the displacement obtaining each frame in current animation deformation trace, reposition Q (i) of each frame namely in current animation deformation trace becomes:
Q (1)=P (1), namely reference position is constant;
Q (i)=Q (i-1)+V (i), namely the position of follow-up every frame is displacement V (i) basis, former frame position added between this two frame, and wherein bit shift compensation has been done in displacement.
Like this, calculated position Q (i) of each frame of current animation deformation trace by formula (3) ~ (6), namely position Q (i) connecting each frame successively forms current animation deformation trace.
Fig. 5 shows after step S103, obtains object by the actual motion track after animation displacement stretching.
In the embodiment of the present invention, when there are differences between the impact point and the impact point of former animation deformation trace of the movement of current animation actual needs, displacement difference between these two impact points can be shared on each frame of animation, and the mode of sharing is the shift length making the size of the bit shift compensation of each frame all be proportional to this frame in former animation, and all bit shift compensations are added, i.e. M (1)+M (2)+... + M (N)=D-P (N), namely total bit shift compensation just in time equals the displacement difference between two impact points, therefore driven object motion is carried out according to the mode in step S103, just in time can in the end a frame by object move to impact point D place, reach the object that animation displacement is stretched to impact point.The simultaneously obviously animation displacement of each frame performance that stretches is consistent with the speed performance of original animation, and namely inside former animation deformation trace, if a certain section of time shifting is fewer, then stretching is during this period of time also fewer.Fig. 5 shows this result, can see, centre one section inside former animation deformation trace moves fewer, its change in displacement (i.e. bit shift compensation) inside the stretching track of correspondence is also fewer, so just make whole drawing process have certain semanteme, meet the expectation of player to this animate.As a comparison, Fig. 6 shows and adopts the former animation deformation trace of method to Fig. 2 of the animation displacement Uniform Tension of prior art to carry out the result schematic diagram after animation displacement stretching, Fig. 6 adopts the animation displacement stretching mode temporally evenly sharing displacement difference, namely the bit shift compensation of each frame all equals (D-P (N))/(N-1) (the first frame does not need to compensate, and follow-up all evenly shares displacement difference).Can see, the adaptivity that animation displacement stretches cannot be accomplished like this, in the stage that middle displacement is fewer, and the stage that other Displacement Ratio is larger, bit shift compensation does not have difference, inconsistent with the rhythm of original animation deformation trace faster or slower.
Fig. 7 is the structured flowchart of a kind of animation displacement stretching device in the embodiment of the present invention.As shown in Figure 7, this animation displacement stretching device 70 comprises:
Displacement difference computing module 701, for calculating the displacement difference of the impact point of impact point that current animation needs to move to and former animation deformation trace;
Bit shift compensation computing module 702, for calculating the bit shift compensation of each frame in former animation deformation trace, make the size of the bit shift compensation of each frame be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference;
Processing module 703, the displacement of corresponding frame in former animation deformation trace that the bit shift compensation of each frame calculated is added to, thus obtain current animation deformation trace.
Wherein, described bit shift compensation computing module 702 calculates 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, P (i) is the position of each frame in former animation deformation trace, P (N) is the impact point of former animation deformation trace, D is the impact point that current animation needs to move to, and S is the total displacement length of former animation deformation trace.
And described processing module 703 calculates current animation deformation trace 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 the position of the i-th frame in current animation deformation trace.
The specific works process of the animation displacement stretching device 70 of the present embodiment can with reference to the animation displacement drawing process of above-described embodiment, and in this not go into detail.
Fig. 8 is the schematic flow sheet of the motion control method of a kind of game object in the embodiment of the present invention.The present embodiment is aimed at and uses animation displacement to carry out mobile object in gaming, when current animation needs the impact point of impact point (actual target point) and the former animation deformation trace moved to inconsistent, need to obtain new movement locus to drive game object by stretching mode, the method comprising the steps of:
S801, obtain current animation deformation trace by the animation displacement drawing process shown in Fig. 1;
S802, drive game object motion according to described current animation deformation trace.
Wherein, the work implementation procedure of step S801 please refer to the animation displacement drawing process of above-described embodiment, after obtaining current animation deformation trace by step S801, game object motion can be driven according to described current animation deformation trace, wherein, type of drive can adopt the common technology of the art, does not repeat them here.
Fig. 9 is the structured flowchart of the motion control device of a kind of game object in the embodiment of the present invention.This motion control device comprises animation displacement stretching device 70 and driver module 80, wherein, the concrete structure of described animation displacement stretching device as shown in Figure 7, for obtaining current animation deformation trace.And described driver module 80 drives game object motion according to described current animation deformation trace.
In sum, animation displacement drawing process disclosed by the invention, the motion control method of device and game object, device needs the displacement difference of the impact point of impact point and the former animation deformation trace moved to based on current animation, calculate the bit shift compensation of each frame in former animation deformation trace, the size of the bit shift compensation of each frame is made to be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference, then the bit shift compensation of each frame calculated is added in the displacement of corresponding frame in former animation deformation trace, thus obtain current animation deformation trace.Because current animation deformation trace can distribute according to the ratio of the total displacement length of the shift length of each frame in former animation deformation trace and former animation deformation trace; and the displacement that each frame compensates, be proportional to the shift length of this frame in former animation deformation trace.Like this, just can make in whole animation displacement drawing process, the bit shift compensation size of each frame can correspond to the motion speed of object in original animation.Therefore, the motion speed of the drawing process of animation displacement (current animation deformation trace) can be made to show consistent with the motion speed performance of original animation, meet the expection of player to this animation displacement stretching performance, solve and use animation displacement to carry out mobile object in gaming, variant when between the impact point needing the impact point that moves to and original animation, when needing to carry out animation displacement stretched operation, adopt the method for existing animation displacement Uniform Tension that the performance of the motion speed of the drawing process of animation displacement can not be made to meet the motion speed performance of original animation, do not meet the technical matters of player to the expection of this animation displacement stretching performance.
The above is the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications are also considered as protection scope of the present invention.

Claims (12)

1. an animation displacement drawing process, is characterized in that, comprising:
Calculate the displacement difference that current animation needs the impact point of impact point and the former animation deformation trace moved to;
Calculate the bit shift compensation of each frame in former animation deformation trace, make the size of the bit shift compensation of each frame be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference;
The bit shift compensation of each frame calculated is added in the displacement of corresponding frame in former animation deformation trace, thus obtains current animation deformation trace.
2. animation displacement drawing process as claimed in claim 1, be is characterized in that, calculated 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, P (i) is the position of the i-th frame in former animation deformation trace, P (N) is the impact point of former animation deformation trace, D is the impact point that current animation needs to move to, and S is the total displacement length of former animation deformation trace.
3. animation displacement drawing process as claimed in claim 2, is characterized in that, calculate current animation deformation trace 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 the position of the i-th frame in current animation deformation trace.
4. animation displacement drawing process as claimed in claim 1, it is characterized in that, the position of each frame in described former animation deformation trace is the coordinate points of two dimensional surface or three-dimensional coordinate points.
5. animation displacement drawing process as claimed in claim 1, it is characterized in that, the shift length of each frame in described former animation deformation trace is the air line distance between this frame and former frame; Described displacement difference is that the impact point of former animation deformation trace points to current animation and needs the displacement of the impact point moved to.
6. an animation displacement stretching device, is characterized in that, comprising:
Displacement difference computing module, for calculating the displacement difference of the impact point of impact point that current animation needs to move to and former animation deformation trace;
Bit shift compensation computing module, for calculating the bit shift compensation of each frame in former animation deformation trace, make the size of the bit shift compensation of each frame be proportional to the shift length of this frame in former animation deformation trace, and make the addition of the bit shift compensation of all frames in former animation deformation trace equal described displacement difference;
Processing module, the displacement of corresponding frame in former animation deformation trace that the bit shift compensation of each frame calculated is added to, thus obtain current animation deformation trace.
7. animation displacement stretching device as claimed in claim 1, is characterized in that, described bit shift compensation computing module calculates 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, P (i) is the position of each frame in former animation deformation trace, P (N) is the impact point of former animation deformation trace, D is the impact point that current animation needs to move to, and S is the total displacement length of former animation deformation trace.
8. animation displacement stretching device as claimed in claim 7, is characterized in that, described processing module calculates current animation deformation trace 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 the position of the i-th frame in current animation deformation trace.
9. animation displacement stretching device as claimed in claim 1, it is characterized in that, the position of each frame in described former animation deformation trace is the coordinate points of two dimensional surface or three-dimensional coordinate points.
10. animation displacement stretching device as claimed in claim 1, it is characterized in that, the shift length of each frame in described former animation deformation trace is the air line distance between this frame and former frame; Described displacement difference is that the impact point of former animation deformation trace points to current animation and needs the displacement of the impact point moved to.
The motion control method of 11. 1 kinds of game objects, is characterized in that, comprising:
Current animation deformation trace is obtained by the animation displacement drawing process as described in Claims 1 to 5;
Game object motion is driven according to described current animation deformation trace.
The motion control device of 12. 1 kinds of game objects, is characterized in that, comprising:
Animation displacement stretching device as described in any one of claim 6 ~ 10, for obtaining current animation deformation trace;
Driver module, drives game object motion according to described 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 true CN105118079A (en) 2015-12-02
CN105118079B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105551072A (en) * 2015-12-11 2016-05-04 网易(杭州)网络有限公司 Method and system for realizing local real-time movement of role model
CN107577398A (en) * 2017-08-08 2018-01-12 深圳Tcl新技术有限公司 Interface cartoon control method, equipment and storage medium
CN111744196A (en) * 2020-07-03 2020-10-09 珠海西山居移动游戏科技有限公司 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
刘成锁: "平面影像的运动透视表现", 《音画工坊》 *

Cited By (6)

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

Also Published As

Publication number Publication date
CN105118079B (en) 2018-08-07

Similar Documents

Publication Publication Date Title
CN105118079A (en) Method and device for stretching displacement of animation, and motion control method and device
CN106003033B (en) A kind of sixdegree-of-freedom simulation standard Chinese character Writing method with power control
CN106777475B (en) A kind of injection machine arm dynamics synergy emulation method of confined space constraint
CN103870665B (en) Space manipulator aids in docking operation three dimension dynamic simulation method
CN104400783B (en) Tension force and joint position feedback flexible driving unit for robot joint control method
CN112904728A (en) Mechanical arm sliding mode control trajectory tracking method based on improved approach law
CN112218744A (en) System and method for learning agile movement of multi-legged robot
Alexey et al. Stabilization of the motion of a spherical robot using feedbacks
CN105641927A (en) Virtual object steering control method and device
CN102528802A (en) Motion driving method for robot with nine degrees of freedom
CN104589344B (en) A kind of boundary control method suppressing Vibrations of A Flexible Robot Arm
CN107168351A (en) A kind of Shared control method and device of legged type robot
CN105945925B (en) A kind of bionical snake-shaped robot control method
CN111597702A (en) Rocket landing trajectory planning method and device
CN106346480A (en) Multi-freedom-degree injection mold mechanical arm modeling method based on UG and MATLAB
CN106950923A (en) A kind of speed planning method for determining interpolation cycle
CN105022269A (en) Method and device for controlling bionic robotic fish joint
Luo et al. Principle and method of speed control for dynamic walking biped robots
CN107121930B (en) Six Degree-of-Freedom Parallel Platform motion control method based on dummy model
CN104651909B (en) Synchronous coordinated control method of series-parallel automobile electrophoretic painting conveying mechanism
CN110355753A (en) Robot controller, robot control method and storage medium
CN108638466A (en) It is molded open mold control method, system and the device of control system
CN104691086A (en) Attachment control system, method and device
CN104616338A (en) Two-dimensional animation-based time-space consistent variable speed interpolation method
CN111890364A (en) Robot motion control method, device, electronic device 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
GR01 Patent grant
GR01 Patent grant