easy way translating a node

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
Hobi
Posts: 14
Joined: Sun Jul 25, 2004 9:32 am

easy way translating a node

Post by Hobi »

Hi everybody.

I'd like to know what is an easy way to translate a node in its own direction(along its z-axis), when it already has a translation and a rotation.

I haven't found a method for that, so i managed it with a help-vector. It worked, but it is a very circumstantial way. So I wanted to ask some experienced programers how they do that. :?:
Foole
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Post by Foole »

The source for the FPS camera class is a good place to look.

My (C#) code looks like this:

Vector3D movedir = new Vector3D(Speed * Interval, 0, 0);
movedir.RotateXZBy(-mNode.Rotation.Y, new Vector3D());
mNode.Position += movedir;
Post Reply