PDA

View Full Version : Plane translation and rotation math



0Bl!T3R@T0R
01-08-2004, 11:41 AM
more like a begginner's question....

i've seen a lot of code that show how to move on some surface (with keys, with mouse) but i still don't get it...could you pump up the math... it's getting annoyng that i can't even make a program that let's a user run thround room

john
01-08-2004, 08:28 PM
You can compute three orthonormal vectors for a given plane such that one of the vectors is the plane's normal and the other two are (by definition) on the plane. One way of doing this is to pick two different points on the plane and compute a unit vector that spans the two points. This is your second vector; you then compute the third vector by the cross product of the plane's normal and the second vector.

To move a point along the plane then you just need to move a point by linear combinations of the second and third vectors.

cheers,
John