POV-Ray : Newsgroups : povray.off-topic : Flipping a quaternion : Flipping a quaternion Server Time
5 Sep 2024 09:21:53 EDT (-0400)
  Flipping a quaternion  
From: c
Date: 14 Aug 2009 08:53:33
Message: <4a855e4d$1@news.povray.org>
I'm trying to export data from Blender.
If you have ever used Blender you will see that the Y axis is pointing 
forward and the Z axis is pointing up.

My problem is that I need to flip everything so that the Y axis is up 
and the Z axis is forward, so basically swapping the two.
For vectors it's easy, just swap y and z :
[x, y, z] becomes [x, z, y]
and after a lot of searching on the internet I even how to flip a matrix:
{ rx, ry, rz, 0 }
{ ux, uy, uz, 0 }
{ lx, ly, lz, 0 }
{ px, py, pz, 1 }
becomes
{ rx, rz, ry, 0 }
{ lx, lz, ly, 0 }
{ ux, uz, uy, 0 }
{ px, pz, py, 1 }

Both of these seem to work but I can't find how to flip a quaternion.


Post a reply to this message

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