📜 ⬆️ ⬇️

mocap on the knee (Skeletal Animations 2)

On May 12, 2007, Jochen Diehl published a very interesting article "Skeletal Animations" .



Briefly outline the essence:

  1. the article is not skeletal animation (in the first sentence, the author stated: "This is no true bones animation")
  2. data for a 10-frame animation is an array of points (joints)
  3. the author himself MANUALLY points (by pointing the cursor and writing out the coordinates) collected a gait of the person from the recording. He used 10 frames equally distributed in time.
  4. in the process of playing a clip, the animation is smoothed using interpolation
  5. at the end of the article the author proposes to continue his experiment:
    • use time based animation instead of frame based interpolation
    • write down your own actions (jumping, running ...) and try to make smooth transitions between them
    • add shadows
    • add a skeleton and make a ragdoll, dying, as in life
    • unsubscribe to the forum


What attracted me to the method:
')
  1. opportunity not to go deep into 3D modeling - let 3D-modellers be engaged in it
  2. the opportunity NOT to go deep into the problem of transferring 3D to flash - for me for small projects it is useless
  3. A very simple method to get various actions for the characters.

* if it will be interesting, I will write in detail in points the method of adding new movements, characters in the Habré

Further:

First of all, I translated the animation in time based (nothing complicated here):

public function update(time:Number):void { render(currentFrame); currentFrame+=(actionArray.length*time/actionLoopTime); currentFrame = int(currentFrame*100)/100; if(currentFrame>actionFrameNumber) { currentFrame-=actionFrameNumber; } } 


But further, in the process of immersion in the method, I realized that there is still at least one most attractive (for me) opportunity to diversify the crowd of NPC-characters on the screen. It is enough just to deform the initial “skeleton” in the keyframes in the required manner, and get an infinite number of variants of figures and characters.

For example (the code can be seen in the source code Main.handleGUIChange - I'll just show the essence here):

and all this on the basis of only one single sequence of key frames (!)

a working example collected on the knee can be seen here
example code here

Remarks:


PS: Well, it turned out that the errors in calculating the resulting matrix with the “slopes” were in that instead of degrees I substituted radians into the matrix. Documentation should be read better!
Perezalivayu with corrections.

Source: https://habr.com/ru/post/238049/


All Articles