Character animation
I''ve created a human character and I loaded it into my program, so I can now view it, rotating it, translating it, etc...
But how can I animate it to make it walk, run, jump, etc...?
Wheter use a file format which supports animation
or use some kind of inverse kinematics
bare stuff
just (all rotation around the point that stick them to the body), this is for a leg
push the matrix
rotate the whole leg
push the matrix
rotate the down leg and foot
push the matrix
rotate the foot
push the matrix
rotate toe
pop the matrix
push the matrix
rotate toe2
pop the matrix
push the matrix
rotate toe3
pop the matrix
pop the matrix
pop the matrix
pop the matrix
push the matrix
DO it for the other leg ..
pop the matrix
You should, anyway start to the torso and go to the body extremities
Hope you understand
or use some kind of inverse kinematics
bare stuff
just (all rotation around the point that stick them to the body), this is for a leg
push the matrix
rotate the whole leg
push the matrix
rotate the down leg and foot
push the matrix
rotate the foot
push the matrix
rotate toe
pop the matrix
push the matrix
rotate toe2
pop the matrix
push the matrix
rotate toe3
pop the matrix
pop the matrix
pop the matrix
pop the matrix
push the matrix
DO it for the other leg ..
pop the matrix
You should, anyway start to the torso and go to the body extremities
Hope you understand
(you can find me on IRC : #opengl on undernet)
Then you can animate easily by storing keyframes of your move that stores all rotation ...
So, you should create a keyframe file format, based on your model that have all the rotations in.
I think it''s the best way to make character animation, cuz, It does''t take a lot of memory nor a lot of coding. And making a little utility that allows you to create keyframes will make your life a lot easier. You''ll get cutting edge character animation.
That was for the theory, I think, I don''t need to explain coding it, it''s just bare easy stuff, so, I''ll let you do it.
Ah yeah, use classes
such as
Here LoadPosI would load interpolated (between two) keyframes. It''s easy to do, Doing it that way will allow you to have smooth moves.
I am not going to write member functions for you I think you know enough to start coding, If you have any problem, feel free to mail me
skslayer@infonie.be
or
slayer@starcraft3d.net
Good luck
So, you should create a keyframe file format, based on your model that have all the rotations in.
I think it''s the best way to make character animation, cuz, It does''t take a lot of memory nor a lot of coding. And making a little utility that allows you to create keyframes will make your life a lot easier. You''ll get cutting edge character animation.
That was for the theory, I think, I don''t need to explain coding it, it''s just bare easy stuff, so, I''ll let you do it.
Ah yeah, use classes
such as
class Body{public:... Constuctors/destructors/... ...void Render();void LoadPos(int KeyFrame1);void LoadPosI(int KeyFrame1,int KeyFrame2,int value);};
Here LoadPosI would load interpolated (between two) keyframes. It''s easy to do, Doing it that way will allow you to have smooth moves.
I am not going to write member functions for you I think you know enough to start coding, If you have any problem, feel free to mail me
skslayer@infonie.be
or
slayer@starcraft3d.net
Good luck
(you can find me on IRC : #opengl on undernet)
You could even do bones animation
(you can find me on IRC : #opengl on undernet)
Thanx to all, It''s more clear now.
I''m using the 3DS file format for loading the character, it also supports keyframes.
I''m using the 3DS file format for loading the character, it also supports keyframes.
With the way I said, you could make a Keyframe editor, name them and do interpolation as you would do in a 3ds file, except that you could easily code a utility that allows you to set up your keyframes and which doesn''t eat any ram (very little I mean).
3Ds uses keyframes based on vertex more than bones, or both, but, if the file contains a model, it will have it as much as there are many keyframes, that makes bigger files. Then you can make animation file (just contains which keyframe follows which one for every move (You can get a walking animation with just 6 keyframes)
I don''t recommend using 3ds file format, I recommend you make a little utility that convert the 3ds file into some file that contains only what you need (You choose yourself the way you want it, but, make a new one, yourself).
3Ds uses keyframes based on vertex more than bones, or both, but, if the file contains a model, it will have it as much as there are many keyframes, that makes bigger files. Then you can make animation file (just contains which keyframe follows which one for every move (You can get a walking animation with just 6 keyframes)
I don''t recommend using 3ds file format, I recommend you make a little utility that convert the 3ds file into some file that contains only what you need (You choose yourself the way you want it, but, make a new one, yourself).
(you can find me on IRC : #opengl on undernet)
You could even work it out a little so you can use any kind of bone structure (mean, not only human)
(you can find me on IRC : #opengl on undernet)
Thax a lot for your feedback.
I find out that the 3ds file format is inadequate...
I''m now on an editor that import models from 3ds and export them to my own file format, make animation and store it into files.
I''ve already coded the 3ds loading and viewing part... but everything else is to be done...
I think I sould not create the model as a unique mesh, but create every animatable part as a separate entity.
I will use these animations in my own game, and I want the faster solution, but I still want things to be the more *professional* I can.
What about poser?
It''s a nice program to model a human figure, doesn''t it?
I find out that the 3ds file format is inadequate...
I''m now on an editor that import models from 3ds and export them to my own file format, make animation and store it into files.
I''ve already coded the 3ds loading and viewing part... but everything else is to be done...
I think I sould not create the model as a unique mesh, but create every animatable part as a separate entity.
I will use these animations in my own game, and I want the faster solution, but I still want things to be the more *professional* I can.
What about poser?
It''s a nice program to model a human figure, doesn''t it?
No need of an editor
just a little converter would do fine
Yeah, using a mesh for every animable part is a good way (the best if having defferents vertex group to every movable part, but it''s harder to do).
And a file that contains initial position (just x,y,z for everymesh) then, just make the keyframe format with rotation of all mesh around its join to parent point. So interpolation is very easy to do and very fast
just a little converter would do fine
Yeah, using a mesh for every animable part is a good way (the best if having defferents vertex group to every movable part, but it''s harder to do).
And a file that contains initial position (just x,y,z for everymesh) then, just make the keyframe format with rotation of all mesh around its join to parent point. So interpolation is very easy to do and very fast
(you can find me on IRC : #opengl on undernet)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement