POV-Ray : Newsgroups : povray.advanced-users : array to matrix : Re: array to matrix Server Time
28 Sep 2024 06:06:17 EDT (-0400)
  Re: array to matrix  
From: Trevor G Quayle
Date: 18 Mar 2011 16:20:01
Message: <web.4d83bd679e47287b81c811d20@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 18/03/2011 19:59, CAD-Andi nous fit lire :
> >> Translate the object to the origin, rotate, translate back.
> >>
> >> translate -Pos
> >> rotate 10*z
> >> rotate 20*y
> >> translate Pos
> >
> > Doing this will apply the second rotation around y to the same axis system like
> > the previous rotation around z. I need to rotate around the "NEW" axis system
> > that got created while I rotated the object around z. In other words, I would
> > like to always rotate around a "local" axis system of an object. The values for
> > this I would like to store in an array for futher programmical canges.
> >
>
> There is rotation only in the reference system.
> Your "new Y" is in fact the rotated Y. It is not new, it is in fact the
> old one.
> Transform it too, and voilà!
>
> So:
> translate -Pos
> rotate 10*z
> rotate vrotate(20*y,10*z)
> translate Pos

The only addition to this is that if what is referred to as the 'local' axis
system in not parallel with the world axis system, not just at a different
origin.  This is still relatively simple if you know these rotations, just
another level of rotates and unrotates to move to the global origin and back
again.

-tgq


Post a reply to this message

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