|
|
Spider wrote in message <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 :-)
It sure is. I don't know if it's worth doing it in POV script, though.
It's not exactly an object-oriented language.
matrix M= I; // identity matrix
M.rotate (n*x);
M.rotate (n*y);
M.rotate (n*z);
M.translate (whatever);
// ... later
someObject.rotate (M); // do the whole thing as one step
anotherObject.rotate (M); // same value used here.
--John
Post a reply to this message
|
|