Quaternions and Rotation Matrices

The Matrix3D structure defines Rotate, RotateAt, RotatePrepend, and RotateAtPrepend methods to apply a rotation transform to the current transform stored by the Matrix3D object. However, the argument to these methods is not an angle and rotation axis, but a quaternion. If you want to create a Matrix3D object from an angle and rotation axis using these methods, you first need to create a Quaternion object from the constructor that accepts an angle and rotation axis.

Or, you could define the Matrix3D object itself directly from the four properties of the Quaternion object. Converting a rotation quaternion to a rotation matrix is fairly straightforward, but it's written in a couple different ways. (All of them are ...

Get 3D Programming for Windows® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.