PDA

View Full Version : Vector Question



tgraupmann
01-27-2004, 12:04 PM
This is the REAL question:


Given p, v, vView, vStrafe, and vUpStrafe are vectors.

If:

p = vView*v.Z + vStrafe*v.X + vUpStrafe*v.Y;

What is the value of v, if p, vView, vStrafe, and vUpStrafe are known?


vView, vStrafe, and vUpStrafe are orthogonal vectors. p is a world coordinate. v is a vertex in object coordinates.

tgraupmann
01-27-2004, 08:27 PM
9 Trillian Thanks.

Solution was as follows:

I wanted point V to be transfered from vVector space into mVector space.

This was the point in world coordinates:

p = vView*v.Z + vStrafe*v.X + vUpStrafe*v.Y;

and I wanted it to be divided by my destination vector.

m.X = p.X*mStrafe.X + p.Y*mStrafe.Y + p.Z*mStrafe.Z;
m.Y = p.X*mUpStrafe.X + p.Y*mUpStrafe.Y + p.Z*mUpStrafe.Z;
m.Z = p.X*mView.X + p.Y*mView.Y + p.Z*mView.Z;

Because the destination model uses the same calculation:
t = mView*m.Z + mStrafe*m.X + mUpStrafe*m.Y;

The result is that p == t. Which is exactly what I wanted. Thanks ALL!!!