Model Animation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
gamerfan
Posts: 43
Joined: Mon Nov 30, 2009 9:28 am

Model Animation

Post by gamerfan »

I have a md2 model that can run.I have added in the code like this:

Code: Select all

mesh.setMD2Animation(EMD2_ANIMATION_TYPE.EMAT_RUN);
This is running at its own position.But I need to make this model to be run for a few yards.Can I do it by changing its position, if so how

Thanks in advance[/code]
Destructavator
Posts: 40
Joined: Sat Feb 06, 2010 9:00 pm
Location: Ohio, USA

Post by Destructavator »

Well, I'm not an expert at Irrlicht but I know of at least two ways:

1) Use an animator, such as the "Fly Straight" one, and after creating it attach it to the animated scene node that has your mesh. With this you can specify the start and end point, exactly how far it travels.

2) You can use MeshSceneNode->setPosition() repeatedly in small increments along a path, although you would need to set those "steps" along with a timer if you want framerate-independent movement so the motion appears to be at a constant speed.

Both of these methods are detailed in the tutorials with the API, I'd start with the "movement" tutorial, which is number 4.

Did I understand your problem correctly?
gamerfan
Posts: 43
Joined: Mon Nov 30, 2009 9:28 am

Post by gamerfan »

Yes.You got the point.
If I use , fly straight animator, it will take only straight line if my understanding correct.But I need the model to move in custom way rather than using any animator effects.I did not know whether this is possible the way you suggested using by timer and thought there would be better way to do this.That is why I just posted in the forum.Let me try this.

Thanks
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

you can also try my IrrSteer !!! 8)
it's still in an early state, but probably enough for your needs atm... ;)
check out the Project Announcement !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
gamerfan
Posts: 43
Joined: Mon Nov 30, 2009 9:28 am

Post by gamerfan »

Thanks Acki.BTW, do you have any documents for this?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

gamerfan wrote:Thanks Acki.BTW, do you have any documents for this?
no, not at the moment...
perhaps I'll start one today (Doxygen documentation)... ;)

but I made a small tutorial on how to use IrrSteer here !!! 8)

for IrrOpenSteer I already made a documentation, it's included to the sdk... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply