Page 1 of 1

easy way translating a node

Posted: Fri Sep 09, 2005 9:19 am
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. :?:

Posted: Fri Sep 09, 2005 11:21 am
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;