Hey guys..
I would to use a existing 3D model (I know that is animated).. But, when I use them, how can I find the first and last frame of the animation and what is the animation speed? Can I find this information by programming? Irrlicht have a method who show me these data ?
Please, help me...
Sorry my ugly english, but this is my question.
Thanks.
How to discover an animation in a 3d model (example: gun.x)?
IAnimatedMeshSceneNode
not sure how to see how many are there if you dont already know though.... lemme look around....
Code: Select all
//! Returns the current displayed frame number.
virtual f32 getFrameNr() const = 0;
//! Returns the current start frame number.
virtual s32 getStartFrame() const = 0;
//! Returns the current end frame number.
virtual s32 getEndFrame() const = 0;
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
Your gun or whatever model can have whatever animation you want, but you need to create it (animate the model). All your questions related to the frames, speed etc. are quite weird. Usually you create the model with its animations and export them as a whole sequence. Like if you have character animations say:
a) idle 1-24
b) walk 25-49
c) run 50-74
d) attack 75-100
It`s exported as one whole sequence with frames 1-100, and you need to play the animation loop between the frames and set speed using the functions Seven already posted (browse the functions of IAnimatedMeshSceneNode).
Like for playing run animation:
If you have different files idle.x, walk.x etc. You combine them in one whole sequence to be used in Irrlicht via some modelling program.
EDIT: It`s all in the Irrlicht examples- take a look. If you want to use an animated model, which animation start and end frames you don`t know, you can easily create some code to change the start and end frames when keys were pressed and display them on screen- after a bit of "looking for the right combination" you write them down and you`re done.
a) idle 1-24
b) walk 25-49
c) run 50-74
d) attack 75-100
It`s exported as one whole sequence with frames 1-100, and you need to play the animation loop between the frames and set speed using the functions Seven already posted (browse the functions of IAnimatedMeshSceneNode).
Like for playing run animation:
Code: Select all
node->setFrameLoop(50, 74);
EDIT: It`s all in the Irrlicht examples- take a look. If you want to use an animated model, which animation start and end frames you don`t know, you can easily create some code to change the start and end frames when keys were pressed and display them on screen- after a bit of "looking for the right combination" you write them down and you`re done.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
i understand the dilema. You have models but dont know the frame numebrs for each. I once wrote a small app that let me use a scrollbar to manually move through the animations and then i wrote them down. worked fine but i cant seem to find the app for you. should be 'fairly' easy to write i think. if i get time i will make one for you. not sure about my time tonight though. we'll see.