CN104123735B - Method for blending multiple actions - Google Patents
Method for blending multiple actions Download PDFInfo
- Publication number
- CN104123735B CN104123735B CN201410356852.4A CN201410356852A CN104123735B CN 104123735 B CN104123735 B CN 104123735B CN 201410356852 A CN201410356852 A CN 201410356852A CN 104123735 B CN104123735 B CN 104123735B
- Authority
- CN
- China
- Prior art keywords
- action
- weight value
- current
- actions
- elapsed time
- 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.)
- Expired - Fee Related
Links
- 230000009471 action Effects 0.000 title claims abstract description 203
- 238000002156 mixing Methods 0.000 title claims abstract description 34
- 238000000034 method Methods 0.000 title claims abstract description 26
- 210000000988 bone and bone Anatomy 0.000 claims abstract description 30
- 239000011159 matrix material Substances 0.000 claims abstract description 9
- 230000033001 locomotion Effects 0.000 claims description 22
- 125000004122 cyclic group Chemical group 0.000 claims description 21
- 238000013519 translation Methods 0.000 claims description 14
- 230000008859 change Effects 0.000 claims description 9
- 230000001186 cumulative effect Effects 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 abstract description 8
- 238000009825 accumulation Methods 0.000 abstract description 4
- 230000000694 effects Effects 0.000 abstract description 2
- 238000006073 displacement reaction Methods 0.000 abstract 2
- 239000000203 mixture Substances 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 125000002015 acyclic group Chemical group 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention relates to a method for blending multiple actions. The method includes the following steps: a. providing multiple actions which are required and capable of acting on the same framework system; b. calculating the current weighted value of each action; c. acquiring the action blending total time length required by blending of the multiple actions; d. acquiring action elapse time; e. conducting interpolation calculation on key frames to obtain rotating component, displacement component and zooming component of each action acting on the framework system; f. conducting accumulation to obtain the rotating component, the displacement component and the zooming component obtained through blending of multiple actions on the bone, conducting calculation according to the parent child relationship between the bone and the current weight values of the actions to obtain a world matrix of each bone action and acquiring the new position and orientation of the bone according to the relation between a top point and the bone effect to achieve blending of multiple actions. The method for blending multiple actions is convenient to implement and capable of effectively achieving multi action blending, saves resources and improves efficiency.
Description
Technical Field
The invention relates to a method, in particular to a method capable of realizing multi-action mixing, which is particularly used for multi-action mixing in a three-dimensional game and belongs to the technical field of image processing.
Background
With the rapid development of the hardware level of modern computers, more and more sophisticated models are used in three-dimensional games to simulate the actions of real characters, and the action processing technology of characters starts from the game character planning and spans four major parts of art, actions and engines in the games. In a game, the action of the chief role occupies a more important part, and the mixing of different actions can be realized to reduce complex calculation, wherein the action mixing relates to the fusion of a plurality of technologies and the use processing skill of related software and a platform. The current character action is made in different games, does not have a uniform specification, and the part is a more critical part in game design.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a method capable of realizing the mixing of multiple actions, which is convenient to implement, capable of effectively realizing the mixing of multiple actions, saving resources, improving efficiency and wide in application range.
According to the technical scheme provided by the invention, the method for mixing the actions comprises the following steps:
a. providing a plurality of required actions capable of acting on the same skeleton system, and converting non-cyclic actions required in the plurality of provided actions into cyclic actions;
b. calculating to obtain a current weight value of each action according to the plurality of provided actions and the determined target weight value of each action and the gradual change time corresponding to each action;
c. calculating to obtain the action mixing total duration after the actions are mixed according to the current weight value of each action;
d. obtaining the elapsed time of the action according to the total action duration, the total action mixing duration and the system elapsed time of the action;
e. determining a key frame corresponding to the current frame according to the elapsed time of the action, and then interpolating the key frame to calculate a rotation component, a translation component and a scaling component of each action acting on the skeleton system;
f. and accumulating according to the rotation component, the translation component and the scaling component of each action to obtain a rotation amount, a translation amount and a scaling amount after the plurality of actions are mixed, placing the rotation amount, the translation amount and the scaling amount on bones, obtaining a world matrix of each bone motion according to a parent-child relationship among the bones and a current weight value of each action, and obtaining a new position and orientation of the bones according to a relationship that a vertex is influenced by the bones to realize the mixing of the plurality of actions.
In the step a, the method for converting the non-cyclic action into the cyclic action includes inserting a key frame of the non-cyclic action into a last frame of the non-cyclic action, where the content of the key frame is the same as the content of a first frame of the non-cyclic action.
In the step b, if the current elapsed time is not less than the fade time of the current action, the current weight value of the action is set as the target weight value.
In the step b, if the current elapsed time is less than the current elapsed timeAt the time of fade of the front action, the current weight value QdComprises the following steps:
Qd=w*Qm+(1-w)*Qz
wherein,T1for the current elapsed time, T2Is a fade time; qmIs a target weight value, QzIs the weight value of the action itself.
In the step c, the current accumulated weight value Q is obtained according to the current weight value of the given actionsThe current accumulated weight value QsComprises the following steps:
where N is the number of mixing actions required, Qd(i) The current weight value of the ith action; if the current accumulative weight value is not 1, the current accumulative weight value Q issThe following settings are set:
wherein, TzTotal duration of motion mix, Q'sIs a current cumulative weight value other than 1.
The elapsed time T of the actiondIs composed of
Td=Ts*λ
Wherein, TdFor the lapse time of the action, TsFor the system elapsed time, λ is a scaling factor,TPfor the total duration of all actions, TzThe total duration of the action mix.
The invention has the advantages that: the action is preprocessed as required, the total time of the mixed action and the cumulative weight value of the mixed action can be obtained through calculation of the preprocessed action, and the world matrix reflecting the skeleton track is obtained after processing is carried out according to the total time of the mixed action and the cumulative weight value of the mixed action, so that the ordered playing of the mixed actions can be realized, the method is suitable for any platform and scene, resources can be saved, and the calculation efficiency is improved.
Drawings
FIG. 1 is a flow chart of the operation of the present invention.
Detailed Description
The invention is further illustrated by the following specific figures and examples.
As shown in fig. 1: in order to effectively realize the mixing of various actions, save resources and improve efficiency, the method for mixing various actions comprises the following steps:
a. providing a plurality of required actions capable of acting on the same skeleton system, and converting non-cyclic actions required in the plurality of provided actions into cyclic actions;
specifically, the mixing of multiple actions is to apply multiple actions to the same skeleton system, and the same skeleton system means that the number of bones, parent-child relationships among bones, bone names, and the like in the skeleton system are the same, and the mixing of multiple actions can be performed only for the same skeleton system.
The first frame of the action and the last frame of the action have the same content, and the action is played circularly without stop. In some cases, some actions to be mixed may be kept in a circulating state, some actions may be kept in an acyclic state, some actions may be converted from acyclic actions to circulating actions, and the specific case may be selected according to the requirement of action mixing. In the embodiment of the invention, the method for converting the non-cyclic action into the cyclic action comprises the step of inserting a key frame of the non-cyclic action into the last frame of the non-cyclic action, wherein the content of the key frame is the same as that of the first frame of the non-cyclic action.
b. Calculating to obtain a current weight value of each action according to the plurality of provided actions and the determined target weight value of each action and the gradual change time corresponding to each action;
in the embodiment of the invention, the target weight value of the action and the gradual change time of the action are used for describing the amplitude acting on the same bone, so that the mixture of the actions can gradually influence the action of the bone instead of enabling the action of the bone to generate abrupt change. In the implementation, the target weight value of each action and the gradual change time of each action are preset by the art designer and are known quantities.
The gradual change time is the time taken for the action to reach a stable state along with the time lapse in the process of affecting the skeleton from the beginning of the action, the current weight value of the action affecting the skeleton in the process is increased from 0 to 1, and the current weight value is equal to the target weight value of the action when the amplitude of the action affecting the skeleton reaches the maximum. In addition, the name of each action and the target weight value corresponding to each action are stored in the action list so as to carry out the required table look-up operation.
The process of action mixing is that the current weight value of a plurality of actions affecting the same skeleton is increased from 0 to 1, and the current action target weight value is not reached yet. The current weight value is a transformation amount, and meanwhile, the self weight value of each action is also required to be involved to calculate the transformed current weight value, and the mixing process is also divided into two cases, specifically:
1) and if the current elapsed time is not less than the gradual change time of the current action, setting the current weight value of the action as the target weight value.
2) If the current elapsed time is less than the gradual change time of the current action, the current weight value QdComprises the following steps:
Qd=w*Qm+(1-w)*Qz
wherein,T1for the current elapsed time, T2Is a fade time; qmIs a target weight value, QzIs the weight value of the action itself. Generally, the weight value of the action itself is set to a value of 1. The current elapsed time is the time from the start of the action play to the transition of the current frame.
c. Calculating to obtain the action mixing total duration after the actions are mixed according to the current weight value of each action;
specifically, according to the current weight value of a given action, the current accumulated weight value Q is obtainedsThe current accumulated weight value QsComprises the following steps:
where N is the number of mixing actions required, Qd(i) The current weight value of the ith action; the total duration of each action refers to the time required to complete an action individually. The accumulated weight value is the accumulation of the current weight values of the N actions.
If the current accumulative weight value is not 1, the current accumulative weight value Q issThe following settings are set:
wherein, TzTotal duration of motion mix, Q'sIs a current cumulative weight value other than 1. In specific implementation, the current accumulated weight value obtained by accumulation may not be 1, and since the weight value of the skeleton affected by the specified action must be 1, the action can be played correctly under such a condition, and at this time, when the accumulated weight value is not 1, the current accumulated weight value is set as a quotient of the total duration of the action mixture and the current accumulated weight value.
d. Obtaining the elapsed time of the action according to the total action duration, the total action mixing duration and the system elapsed time of the action;
the elapsed time T of the actiondIs composed of
Td=Ts*λ
Wherein, TdFor the lapse time of the action, TsFor the system elapsed time, λ is a scaling factor,TPfor the total duration of all actions, TzThe total duration of the action mix. The total duration of the action TPRefers to the cumulative sum of all action fade times.
The elapsed time of the system is the time currently elapsed by the mixed action, and is the time taken by the action playing time to a certain moment of the system, and the time is not changed with the specific action played and is not related to factors such as the time required by the playing of a single action.
For example: setting the elapsed time of action 1 between key frames 2 and 3; the elapsed time of action 2 is between key frames 4 and 5; the elapsed time of action 3 is between key frames 1 and 2.
When the whole action is to be finished orderly and continuously, and when the actions are mixed, a plurality of actions are played simultaneously, and the playing time of a single action is different, for example, when the time required for finishing a mixed action is 5S, the playing time of the action 1 is 3S, and the playing time of the action 2 is 6S, the action 1 must be slowly played until the 5S is finished, the time can be adjusted, and for the action 2, the quick playing is required to compress the time into 5S; if the play time of action 3 is 5S, the whole action can be played normally. Therefore, when the motion is completed, all the motions acting on the whole skeleton end the playing of the motion at 5S.
By setting the fast-playing and slow-playing of the motion and the time between which two key frames the motion passes, the linear and spherical interpolation of the data between these key frames of a plurality of motions can be calculated to obtain the rotation, translation and scaling components of each motion. In the embodiment of the present invention, the calculation of the linear time interpolation and the spherical interpolation performed on the key frame may adopt a common calculation method in the technical field, and details are not described here.
e. Determining a key frame corresponding to the current frame according to the elapsed time of the action, and then interpolating the key frame to calculate a rotation component, a translation component and a scaling component of each action acting on the skeleton system;
f. and accumulating according to the rotation component, the translation component and the scaling component of each action to obtain a rotation amount, a translation amount and a scaling amount after the plurality of actions are mixed, placing the rotation amount, the translation amount and the scaling amount on bones, obtaining a world matrix of each bone motion according to a parent-child relationship among the bones and a current weight value of each action, and obtaining a new position and orientation of the bones according to a relationship that a vertex is influenced by the bones to realize the mixing of the plurality of actions.
When the trajectory motion of the skeleton is realized, the trajectory motion of the skeleton can be determined according to the playing of the key frames and interpolation between the key frames, and the trajectory list of the skeleton, namely the position of the skeleton, is updated, and the determined trajectory motion process of the skeleton is carried out. In the embodiment of the invention, the parent-child relationship among bones is determined when the bones are modeled, the relationship of the top points influenced by the bones is also determined, when the rotation amount, the translation amount and the zoom amount after the multiple actions are mixed are obtained through accumulation, a world matrix of the bone motion is obtained, the world matrix is transmitted to a GPU (graphic processing Unit) of a computer system, and after the world matrix is processed and calculated by the GPU, the mixed effect of the multiple actions can be realized.
According to the invention, through the required preprocessing of the actions, the total time of the mixed actions and the cumulative weight value of the mixed actions can be calculated for the preprocessed actions, and then the world matrix reflecting the skeleton track can be obtained after the preprocessing is carried out according to the total time of the mixed actions and the cumulative weight value of the mixed actions, so that the ordered playing of the mixed actions can be realized, the method can be applied to any platform and scene, the resources can be saved, and the calculation efficiency can be improved.
Claims (3)
1. A method for enabling a plurality of actions to be mixed, the method comprising the steps of:
(a) providing a plurality of required actions capable of acting on the same skeleton system, and converting non-cyclic actions required in the plurality of provided actions into cyclic actions;
(b) calculating to obtain a current weight value of each action according to the plurality of provided actions and the determined target weight value of each action and the gradual change time corresponding to each action;
in the step (b), if the current elapsed time is not less than the fade time of the current action, setting the current weight value of the action as the target weight value;
in the step (b), when the current elapsed time is less than the fade time of the current action, the current weight value Q isdComprises the following steps:
Qd=w*Qm+(1-w)*Qz
wherein,T1for the current elapsed time, T2Is a fade time; qmIs a target weight value, QzThe weight value of the action itself;
(c) calculating to obtain the action mixing total duration after the actions are mixed according to the current weight value of each action;
in the step (c), the current accumulated weight value Q is obtained according to the current weight value of the given actionsThe current accumulated weight value QsComprises the following steps:
where N is the number of mixing actions required, Qd(i) The current weight value of the ith action; if the current accumulative weight value is not 1, the current accumulative weight value Q issThe following settings are set:
wherein, TzTotal duration of motion mix, Q'sIs the current cumulative weight value which is not 1;
(d) obtaining the elapsed time of the action according to the total action duration of the mixed action, the total action mixed duration and the system elapsed time;
(e) determining a key frame corresponding to the current frame according to the elapsed time of the action, and then interpolating the key frame to calculate a rotation component, a translation component and a scaling component of each action acting on the skeleton system;
(f) and accumulating according to the rotation component, the translation component and the scaling component of each action to obtain the rotation amount, the translation amount and the scaling amount after the multiple actions are mixed, placing the mixed rotation amount, the translation amount and the scaling amount on bones, obtaining a world matrix of each bone motion according to the father-son relationship among the bones and the current weight value of each action, and obtaining the new position and orientation of the bones according to the relationship that the vertex is influenced by the bones to realize the mixing of the multiple actions.
2. The method of claim 1, wherein the method comprises: in the step (a), the method for converting the non-cyclic motion into the cyclic motion includes inserting a key frame of the non-cyclic motion into a last frame of the non-cyclic motion, where the content of the key frame is the same as the content of a first frame of the non-cyclic motion.
3. The method of claim 1, wherein the method comprises: the elapsed time T of the actiondIs composed of
Td=Ts*λ
Wherein, TdFor the lapse time of the action, TsFor the system elapsed time, λ is a scaling factor,TPfor all that isTotal duration of action, TzThe total duration of the action mix.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410356852.4A CN104123735B (en) | 2014-07-24 | 2014-07-24 | Method for blending multiple actions |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410356852.4A CN104123735B (en) | 2014-07-24 | 2014-07-24 | Method for blending multiple actions |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104123735A CN104123735A (en) | 2014-10-29 |
CN104123735B true CN104123735B (en) | 2017-05-10 |
Family
ID=51769132
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410356852.4A Expired - Fee Related CN104123735B (en) | 2014-07-24 | 2014-07-24 | Method for blending multiple actions |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104123735B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105578184B (en) * | 2016-01-27 | 2018-11-20 | 努比亚技术有限公司 | The generating means and method of key-frame animation |
CN105894555B (en) * | 2016-03-30 | 2020-02-11 | 腾讯科技(深圳)有限公司 | Method and device for simulating limb actions of animation model |
CN109481940A (en) * | 2018-09-21 | 2019-03-19 | 苏州蜗牛数字科技股份有限公司 | A kind of Moving Objects follower method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1192812A (en) * | 1995-06-28 | 1998-09-09 | 阿里·范维林根视频胶片产品公司 | Device and method for controlling movable apparatus |
US6535215B1 (en) * | 1999-08-06 | 2003-03-18 | Vcom3D, Incorporated | Method for animating 3-D computer generated characters |
CN101356549A (en) * | 2003-05-14 | 2009-01-28 | 皮克萨公司 | Defrobulated angles for character joint representation |
CN101473352A (en) * | 2006-04-24 | 2009-07-01 | 索尼株式会社 | Performance driven facial animation |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1012791A1 (en) * | 1996-04-04 | 2000-06-28 | Katrix Inc. | Limb coordination system for interactive computer animation of articulated characters with blended motion data |
-
2014
- 2014-07-24 CN CN201410356852.4A patent/CN104123735B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1192812A (en) * | 1995-06-28 | 1998-09-09 | 阿里·范维林根视频胶片产品公司 | Device and method for controlling movable apparatus |
US6535215B1 (en) * | 1999-08-06 | 2003-03-18 | Vcom3D, Incorporated | Method for animating 3-D computer generated characters |
CN101356549A (en) * | 2003-05-14 | 2009-01-28 | 皮克萨公司 | Defrobulated angles for character joint representation |
CN101473352A (en) * | 2006-04-24 | 2009-07-01 | 索尼株式会社 | Performance driven facial animation |
Non-Patent Citations (3)
Title |
---|
Flexible automatic motion blending with registration curves;Kovar L et al.;《ACM SIGGRAPH/Eurographics Symposium on Computer Animation》;20030726;第214-224页 * |
虚拟角色交互框架及动画混合的研究与实现;罗植尹;《中国优秀硕士学位论文全文数据库 信息科技辑》;20111215(第12期);第I138-1006页 * |
骨骼动画技术的研究与实现;袁会杰;《中国优秀硕士学位论文全文数据库 信息科技辑》;20110415(第4期);第I138-877页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104123735A (en) | 2014-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104112288B (en) | Three-dimensional skeleton model based action transition achieving method | |
CN112669414B (en) | Animation data processing method and device, storage medium and computer equipment | |
CN101854986A (en) | Movement animation method and apparatus | |
CN110992495B (en) | Method and device for deforming virtual model | |
CN111462283B (en) | Method, medium, device and apparatus for playing large number of same character animations | |
CN111540024A (en) | Model rendering method and device, electronic equipment and storage medium | |
CN104123735B (en) | Method for blending multiple actions | |
EP3832604A1 (en) | Animation control method and device, storage medium, and electronic device | |
CN111738935B (en) | Ghost rendering method and device, storage medium and electronic device | |
WO2012024852A1 (en) | Method for enabling animation during screen switching and mobile terminal | |
CN109801350B (en) | Character motion simulation method based on example animation | |
CN114053696B (en) | Image rendering processing method and device and electronic equipment | |
CN111932659A (en) | Method for processing skeleton model data, computer device and storage medium | |
CN107230244A (en) | The generation method and rendering system of a kind of animation file | |
CN106204418A (en) | Image warping method based on matrix inversion operation in a kind of virtual reality mobile terminal | |
CN111640170B (en) | Bone animation generation method, device, computer equipment and storage medium | |
CN105118081A (en) | Processing method and device for picture synthesis video | |
CN106202162B (en) | It is a kind of for test recommend room data list test macro and method | |
CN102752491B (en) | The generation method and system of a kind of satellite trajectory | |
US20230120883A1 (en) | Inferred skeletal structure for practical 3d assets | |
CN111973988A (en) | Game model processing method, device, equipment and storage medium | |
CN116385605A (en) | Method and device for generating flight animation of target object and electronic equipment | |
CN116843809A (en) | Virtual character processing method and device | |
CN109847360A (en) | 3D effect processing method, device, electronic equipment and the medium of game item | |
CN114255312A (en) | Processing method and device of vegetation image and electronic equipment |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170510 |
|
CF01 | Termination of patent right due to non-payment of annual fee |