POV-Ray : Newsgroups : povray.advanced-users : Get Euler angles from unit vector? : Re: Get Euler angles from unit vector? Server Time
20 Apr 2024 03:54:03 EDT (-0400)
  Re: Get Euler angles from unit vector?  
From: clipka
Date: 28 Sep 2018 00:27:21
Message: <5badada9$1@news.povray.org>
Am 28.09.2018 um 03:27 schrieb Mike Horvath:
> Two important questions I have (that may not be explained in the docs),
> is how to convert a 3x3 rotation matrix to POV-Ray syntax, and how to
> determine the inverse matrix?

given a matrix

     / a  b  c \
    (  d  e  f  )
     \ g  h  i /

you have to specify either

    matrix < a, b, c,
             d, e, f,
             g, h, i,
             0, 0, 0 >

or
    matrix < a, d, g,
             b, e, h,
             c, f, i,
             0, 0, 0 >

The order depends on whether the original matrix is specified in
"mathematical" or "computer graphics" style - they're mirrored along the
diagonal. Can't remember which one POV-Ray uses.

Determining the inverse /transformation/ is simple:

    #declare Foo = transform { matrix < ... > }
    #declare FooInv = transform { Foo inverse }

Actually getting at the corresponding matrix is possible by applying the
inverted transformation to the axis vectors.


Post a reply to this message

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