POV-Ray : Newsgroups : povray.general : computed rotate in macros : Re: computed rotate in macros Server Time
12 Aug 2024 09:24:42 EDT (-0400)
  Re: computed rotate in macros  
From: Rudy Velthuis
Date: 28 Feb 1999 16:02:56
Message: <36d9af00.0@news.povray.org>
Spider schrieb in Nachricht <36D99EA7.F4436A97@bahnhof.se>...
>Another one in this discussion, I have several rotate and a translate, as
this :
>
>
>rotate <nX,0,0>
>rotate <0,nY,0>
>rotate <0,nZ,0>
>translate <0,nL,0>
>
>Now I wonder, is it possible to make this into only one rotate/translate,
or,
>even better into a matrix (I don't know the math, I only want to know if it
is
>possible, as so far.)
>If it is possible to make only one matrix, can I combine two of them into
only
>one ?? (yes, macro :-)


Yes, you can, using matrix multiplication. There is a good tutorial
somewhere on the web (John's Pov Matrix Page:
http://www.erols.com/vansickl/matrix.htm). I would recommend reading this.
It's good. You can also find this in any math textbook.

But you could *propably* just as well combine the rotations like this:

rotate <nX, nY + nZ, 0>
translate nL * y

I think this is the correct order POV-Ray does this.
--
Rudy Velthuis


Post a reply to this message

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