Reading model coordinates into irrlicht

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
headfonez
Posts: 12
Joined: Wed Oct 31, 2007 2:04 pm

Reading model coordinates into irrlicht

Post by headfonez »

Is there a way to get the position of a mesh as it is animating? I have animated a mesh (moving along the x y and z axis in 3ds max), and I want to get those coordinates in irrlicht. Is there a way to get these coordinates? So far, when I place the object in irrlicht, it plays the animation of the mesh moving in the x, y and z, but the position reads as x = 0, y = 0, and z = 0 when I use the getPosition() function.

Note, the model I've been using so far is md2. Thanks.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Not really. Well at least not accurately. The problem is that the origin of the models local coordinate system is usually (0, 0, 0). When you animate the vertices of the model away from the origin, the position of the mesh doesn't change, just the position of the vertices relative to the local coordinate system origin.

You might be able to use the center of the bounding box, but that point will move around when the vertices change shape. That may not be good enough.

Travis
headfonez
Posts: 12
Joined: Wed Oct 31, 2007 2:04 pm

Post by headfonez »

That's exactly what I needed. Thanks!
Post Reply