POV-Ray : Newsgroups : povray.advanced-users : array to matrix : Re: array to matrix Server Time
28 Sep 2024 06:13:09 EDT (-0400)
  Re: array to matrix  
From: Le Forgeron
Date: 18 Mar 2011 16:03:13
Message: <4d83ba81$1@news.povray.org>
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


Post a reply to this message

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