POV-Ray : Newsgroups : povray.binaries.images : Rotation matrices : Rotation matrices Server Time
9 May 2021 07:28:12 EDT (-0400)
  Rotation matrices  
From: Bald Eagle
Date: 31 Mar 2021 20:20:00
Message: <web.6065117d946f4e1c1f9dae3025979125@news.povray.org>
I had the unexpected "opportunity" to review some old code I've had on the
back-burner as a refresher and to look for any errors, and I spotted some errors
in some of the matrix transforms I was using to create some vectors.

Since we use a left-handed coordinate system, and rotation matrices can be a bit
confusing - especially at first - I made a sketch, and then decided it ought to
be added to the collection of documentation diagrams I'm making.

There may be some additional graphics on this specific topics if I find the time
amidst all the other stuff.

As far as I can tell there was no explicit mention of using the formulas of the
transformed basis vectors in isosurface variable substitution on either Mike
Williams' site or Friedrich Lohmueller's.  Though they do appear in POV-Ray's
online documentation.


Note: these rotation substitutions work like normal POV-rotations: they already
compensate for the inverse working

rotate around X
: replace "y" with "z*sin(radians(Angle)) + y*cos(radians(Angle))"
: replace "z" with "z*cos(radians(Angle)) - y*sin(radians(Angle))"

rotate around Y
: replace "x" with "x*cos(radians(Angle)) - z*sin(radians(Angle))"
: replace "z" with "x*sin(radians(Angle)) + z*cos(radians(Angle))"

rotate around Z
: replace "x" with "x*cos(radians(Angle)) + y*sin(radians(Angle))"
: replace "y" with "-x*sin(radians(Angle)) + y*cos(radians(Angle)) "

  rotate z*75   gives:
  P(x*cos(radians(75)) + y*sin(radians(75)),
    -x*sin(radians(75)) + y*cos(radians(75)), z)


Here is a supplementary illustration - it could probably use some polishing.

Post a reply to this message

Download 'rotationmatrices.png' (296 KB)

Preview of image 'rotationmatrices.png'


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