Maths3D

BlitzMax Forums/BlitzMax Programming/Maths3D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Eulers are what everyone knows and uses by default. Axis Angle rotations between 0 and 360, and three axes, X, Y and Z. It's easy to visualize for us humans, but very poor mathematically speaking because the order you do the rotations in defines where you end up. So the same apparent rotation can have several different meanings. Not good from a mathematical standpoint. Not to mention you cannot interpolate between orientations and the Gimbal lock problem.

Quaternions are a much better, much more straightforward approach, but they're nowhere near as easy for the human brain to visualize. Essentially a quaternion is a set of four values describing a single rotation around one axis. The axis is completely arbitrary ( not just x, y and z, but any axis ) and so a single rotation can achieve any rotation possible in the Euler system. X, Y and Z define the axis, and W defines the size of rotation around that axis. Values are between 0 and 1.

Quaternions can be interpolated, and do not suffer from Gimbal lock, so they're very suitable for games use. Also, because they only have four values, they're faster than using matrices.

Let someone else explain matrices, I'm allergic.

There are countless internet resources, and I wouldn't want to pick one out in particular as I found none were exhaustive and I actually needed to pick up bits and pieces from various places. The 3D Math Primer is an excellent book on maths if you're interested.