POV-Ray : Newsgroups : povray.general : grouping transforms into one final rotation? : Re: grouping transforms into one final rotation? Server Time
23 Apr 2024 10:58:50 EDT (-0400)
  Re: grouping transforms into one final rotation?  
From: Bald Eagle
Date: 17 Sep 2018 18:55:02
Message: <web.5ba02ff581dcebf3458c7afe0@news.povray.org>
I think what you need to do is define something like:
X = x, Y = y, and Z = z, and use those as the basis vectors of your overall
transform matrix composition.

Then apply those sequential transforms to those vectors, and then, as an
exercise for you, the alert reader, do trig to get the angles back.

This sounds pretty cool - it should be neat once it's worked out.  :)


I suppose it may be possible to work out the answer purely by matrices:
(see last line)

https://en.wikipedia.org/wiki/Transformation_matrix

Composing and inverting transformations
One of the main motivations for using matrices to represent linear
transformations is that transformations can then be easily composed and
inverted.

Composition is accomplished by matrix multiplication. Row and column vectors are
operated upon by matrices, rows on the right and columns on the left. Since text
reads from left to right, row vectors are preferred when transformation matrices
are composed:

If A and B are the matrices of two linear transformations, then the effect of
applying first A and then B to a row vector x is given by:

{\displaystyle ({\vec {x}}\mathbf {A} )\mathbf {B} ={\vec {x}}(\mathbf {AB} ).}
{\displaystyle ({\vec {x}}\mathbf {A} )\mathbf {B} ={\vec {x}}(\mathbf {AB} ).}


In other words, the matrix of the combined transformation A followed by B is
simply the product of the individual matrices."

I did a brief search to see if anyone had written some macros to do matrix
multiplication - nothing yet, but somewhat related.

http://news.povray.org/povray.advanced-users/thread/%3Chb4nftstffp43ia7le4qpbvassaqhsi2gb%404ax.com%3E/?mtop=63619

http://evilsnack.byethost22.com/matrix.htm?i=1

http://news.povray.org/povray.advanced-users/thread/%3Cslrn94euki.6kk.ron.parker@fwi.com%3E/


and this is in C++, with
"std::ostream &  writePov (std::ostream &os) const
  Write matrix in Povray format."
Which is what grabbed my eye.


http://www.nigels.com/glt/doc/class_matrix.html
http://www.nigels.com/glt/doc/matrix4_8h-source.html


Post a reply to this message

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