Hi all,

I’ve just uploaded a set of quaternion helper objects for Max. You

can find more info here:

http://www.maxobjects.com/?v=libraries&id_library=111

OSX (UB) and Windows.

Enjoy!

Graham

–

Quaternion helper objects. Convert between quaternion, Euler,

cartesian and axis/angle representations.

quat

"Represent, store and transform a quaternion"

"The mul messsage, with a quaternion argument, rotates the stored

quaternion by the argument. bang outputs the stored value. reset sets

it to zero rotation. quat takes an optional int argument – how often

quaternions are normalized. Reduce to improve object efficiency, but

increase to avoid floating point error creeping into the angles.

Default every 30 operations."

axis2quat

Convert an axis/angle rotation (e.g. the output of jit.gl.handle) to

quaternion

euler2quat

Convert Euler rotations (azimuth/elevation/tilt or heading/attitude/

bank or yaw/pitch/roll) to quaternion

quat2axis

Convert quaternion to axis/angle rotation (e.g. most jit.gl rotate

arguments)

quat2car

Select a unit vector in the quaternion rotation

quat2car returns a unit vector representing a principal axis of the

rotation, which can be useful to accumulate positions of moving

objects for example. Argument ‘x’, ‘y’, ‘z, ‘-x’, ‘-y’ or ‘-z’

specifies which axis is the ‘front’

quat2euler

Convert quaternion to Euler angles (azimuth/elevation/tilt or heading/

attitude/bank or yaw/pitch/roll). NOTE: there is a loss of

information in the conversion from quaternion to Euler angles. This

behaviour is matched by the original Shoemake algorithm.

quatpov

Rotate a cartesian point by a quaternion