On May 12, 2007, Jochen Diehl published a very interesting article
"Skeletal Animations" .
Briefly outline the essence:- the article is not skeletal animation (in the first sentence, the author stated: "This is no true bones animation")
- data for a 10-frame animation is an array of points (joints)
- 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.
- in the process of playing a clip, the animation is smoothed using interpolation
- 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:')
- opportunity not to go deep into 3D modeling - let 3D-modellers be engaged in it
- the opportunity NOT to go deep into the problem of transferring 3D to flash - for me for small projects it is useless
- 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):
- shorten the legs and arms ( scale * point.y; scale * point.z; ) - get a gnome
- lengthen your arms and legs ( scale * point.y; scale * point.z; ) - get Uncle Stepou
- narrow the waist and widen the hips ( scale * point.x; ) - get a manly woman
- Zuzu shoulders and rashir waist ( scale * point.x; ) - get effeminate man
- bend the body, bend your knees - bending soldier
- bend the body, bend your knees, tremble in the joints - old man
- change the amplitude of strokes with arms and legs - get a new mood
and all this on the basis of only one single sequence of key frames (!)
a working example collected on the knee can be seen hereexample code hereRemarks:- animation used by the author (Jochen Diehl)
- the tilts in my example work preparishey - this is because I do not understand anything in mathematics and in the rotation matrix in particular. If a kind person tells you how to correctly calculate the resulting rotation matrix based on the available data (default angle, current angle, data from the slider), I will immediately make changes to the working code and add a bunch of other possibilities for changing the shape
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.