Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Vector Question

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    Monroe, WA, USA
    Posts
    13

    Vector Question

    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.

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    Monroe, WA, USA
    Posts
    13

    Re: Vector Question

    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!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •