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 04:06:55 EDT (-0400)
 Re: Convert 313 Cartesian Euler Angles to POV-Ray Coordinates
 From: Tor Olav Kristensen Date: 17 Sep 2022 10:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.6325df737d53bcda864c7c4689db30a9%40news.povray.org",
"headline": "Re: Convert 313 Cartesian Euler Angles to POV-Ray Coordinates",
"dateCreated": "2022-09-17T14:55:00+00:00",
"datePublished": "2022-09-17T14:55:00+00:00",
"author": {
"@type": "Person",
"name": "Tor Olav Kristensen"
}
}
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> "LAP" <nomail@nomail> wrote:
> > I am attempting to use POV-Ray for rigid-body dynamics.
> >
> > I have software that produces rotation parameters as 313 Euler angles, psi,
> > theta, and phi, and the associated 313 rotation matrix.  All this is done in 3D
> > Euclidean (Cartesian) space.
> >
> > The problem I face is converting these Euclidean 313 parameters to work in
> > POV-Ray coordinates.  In other words, I need to convert the Euclidean rotation
> > matrix to a POV-Ray matrix so that I can propery rotate objects (and their
> > textures).
> >
> > Since the basic coordinate transform is <x,y,z> Euclidean to <-z, x, y> I have
> > tried to rearrange the components of the Euclidean 313 rotation matrix to
> > duplicate this transform but the results are not correct.
> >
> > 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.
>...

Sorry. The include statements got messed up. They should be:

#include "vectors.inc"
#include "matrices.inc"

--
Tor Olav
http://subcube.com
https://github.com/t-o-k
```