POV-Ray : Newsgroups : povray.general : Local rotations : Re: Local rotations Server Time
31 Jul 2024 22:09:21 EDT (-0400)
  Re: Local rotations  
From: Urs Holzer
Date: 9 Aug 2006 03:29:21
Message: <44d98ed1@news.povray.org>
Chris B wrote:
> Sorry if I've misunderstood the question, but can't you just apply the
> rotations in the reverse sequence?
> 
> So, if you're doing an animation where you first rotate around y by 70
> degrees then round z by 20 degrees relative to the new position of the
> object, and you're doing the frame that's half way through the second
> rotation you would rotate first by 10 degrees around z, then by 70
> degrees around y, all with respect to the universal axes.

Yes, this should work.

Greg, you can try to imagine what happens. If someone wants to know more
about that: This has to do with linear algebra. rotate and scale are
linear transformations. (Translate is not a linear transformation. The
trick is to use 4 dimensions where the 3-dimensional translate is also
linear.) All linear transformations can be described by matrices. If
you do two transformations after each other, they together are again a
linear transformation. You can get the matrix of this transformation by
simply multiplying the matrices of the other transformations. By
multiplying matrices, the order is important!
In OpenGL (I do not know about DirectX) the multiplication order is the
other way round as in POV-Ray. POV-Ray also has a matrix-transformation
keyword which you can use to do any linear transformation you want.

Happy transformation!


Post a reply to this message

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