POV-Ray : Newsgroups : povray.general : Convert 313 Cartesian Euler Angles to POV-Ray Coordinates : Re: Convert 313 Cartesian Euler Angles to POV-Ray Coordinates Server Time21 Apr 2024 05:26:38 EDT (-0400)
 Re: Convert 313 Cartesian Euler Angles to POV-Ray Coordinates
 From: LAP Date: 24 Sep 2022 13:05:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.632f37ba7d53bcda80f7e38f24a1f89d%40news.povray.org",
"headline": "Re: Convert 313 Cartesian Euler Angles to POV-Ray Coordinates",
"dateCreated": "2022-09-24T17:05:00+00:00",
"datePublished": "2022-09-24T17:05:00+00:00",
"author": {
"@type": "Person",
"name": "LAP"
}
}
> > >
> > > Given a rotation matrix in 3D Euclidean space:
> > >
> > > | 00 01 02 |
> > > | 10 11 12 |
> > > | 20 21 22 |
> > >
> > > What is the correct way of transforming this matrix so that it will rotate a
> > > POV-Ray object in the same way?
> >
> > Hi
> >
> > You may want to have a look at the code below.
> >...

I thank you for your time and effort.

After a lot of trial and error, I believe that I have found a solution.

A 3-1-3 set of Euler angles (or any other variation) gives rise to a rotation
matrix according the formulas found here (and other places):

https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix

As with any rotation matrix, the columns of the matrix correspond to the vectors
that result from rotating each Euclidean basis vector.  (Since rotations are
rigid each column vector is also a unit vector.)

Using the POV Ray transform Shear_Trans(A, B, C), where the vectors A, B, and C
are the column vectors of the Euclidean rotation matrix, I can orient the object
in POV Ray space in the same way as in Euclidean space.

Of course, the column vectors have to be adjusted for the Euclidean [x, y,z] to
POV Ray <x,y,z> coordinate transformation.  This is done as follows.

The Euclidean rotation matrix:

| 11 12 13 |
| 21 22 23 |
| 31 32 33 |

is used to create the POV Ray vectors in this manner:

A = <22, 32, -12>

B = <23, 33, -13>

C = <21, 31, -11>

Using these vectors in Shear_Trans(A, B, C) produces a rotation that is
equivalnt to using the 3-1-3 Euler angles in Euclidean space.

My plan is to perform all calculation with an external program and to feed the
data into POV Ray using variables.
```