Thread: rotation mathematics....

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    it's just re-arranged algebraically.

    the real equation, in the normal human form is this;

    (P - (A . P)A) * cos + (AxP)sin + (A.P)A

    the final they give is:
    Pcos + (AxP)sin + A(A.P)(1-cos)

    the 1-cos comes from the P-(A.P)A. In my code, I use the first version

    P - (A.P)A gives you the perpendicular component. This is hard to explain if you don't already understand it, but A.P gives you a length (its a dotproduct), and when you multiply that by A (which should be a normalized unit vector) you get the vector component that is the projection of P onto A. When you subtract the projection of P onto A from P it gives you the perpendicular component.

    you don't need the last part in the normal human form of the equation if the vectors are already orthogonal, but if they aren't already orthogonal you need to add it in in order for it to represent a rotation (preserve lengths).
    Last edited by Silvercord; 12-09-2003 at 10:57 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. camera rotation matrix
    By Vick jr in forum Game Programming
    Replies: 5
    Last Post: 05-26-2009, 08:16 AM
  2. Image rotation - doesn't always work
    By ulillillia in forum C Programming
    Replies: 12
    Last Post: 05-03-2007, 12:46 PM
  3. Mathematics? (Peculiar Camera Rotation)
    By Epo in forum Game Programming
    Replies: 10
    Last Post: 04-14-2005, 04:18 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. one final problem with rotation
    By DavidP in forum Game Programming
    Replies: 3
    Last Post: 11-19-2003, 03:50 AM