POV-Ray : Newsgroups : povray.advanced-users : Rotation mathematics : Re: Rotation mathematics Server Time
26 Sep 2024 17:44:57 EDT (-0400)
  Re: Rotation mathematics  
From: Francois Labreque
Date: 15 Jan 2001 19:48:04
Message: <3A6399B6.69F204D3@videotron.ca>
Simon Lemieux wrote:
> 
> > > Rotate x: <x,y,z> -> <x,y*cos-z*sin,z*cos+y*sin>
> > > Rotate y: <x,y,z> -> <x*cos+z*sin,y,z*cos-x*sin>
> > > Rotate z: <x,y,z> -> <x*cos-y*sin,y*cos+x*sin,z>
> >
> > This is just for left-handed systems BTW.
> 
> Thanks a lot! Is there a difference between left and right-handed systems?

Yes.  Take you thumb as the Y axis.  your fingers wrap toward a positive
rotation.

As you ca see, the rotations are oppsoite depending on whether you have
a LHS or a RHS.

As for the matrices go,

For a LHS:

      -               -
     |  1    0     0   |
Rx = |  0   cos   sin  |
     |  0  -sin   cos  |
      -               -

And for a RHS:

      -               -
     |  1    0     0   |
Rx = |  0   cos  -sin  |
     |  0   sin   cos  |
      -               -

(As you can see the sign of the sine changes)

-- 
Francois Labreque | Unfortunately, there's no such thing as a snooze
    flabreque     | button on a cat who wants breakfast.
        @         |      - Unattributed quote from rec.humor.funny
   videotron.ca


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.