QuatRot Demo: Downloads and Documentation


Source Code and Executables for Quaternion Rotation Demo QuatRot

All demonstration programs are without guarantees of any kind and subject to this agreement. Please read this before downloading, running, or incorporating any software from this site.


Documentation for Quaternion Rotation Demo: QuatRot

Start the program by running QuatRot.machine for the appropriate platform. The initial display shows an identity frame with Red = x-axis, Green = y-axis, Blue = z-axis. The left-hand border graphs the value of q0, which is yellow when q0 > 0, and blue when q0 < 0. At the center of the coordinate axis triple is a tube that by default shows the exact value of the vector part (qx, qy, qz) of the quaternion representing the current frame.

Since the current frame starts out as the identity, the (qx, qy, qz) tube has zero length and is invisible, while q0 = +1.0. The frame's triple of axes are changed using the rolling ball method (Chapter xx) when the left button is dragged, and around the current screen-perpendicular axis when the middle button is dragged. The user's view is altered without changing the frame by dragging the right button. The central tube is the current vector quaternion corresponding to the result of the sequence of rotations applied to the original identity frame, and the left-hand bar is the value of q0.

The default view shows (qx, qy, qz), omitting the q0 axis, but drawing the q0 value on the left-hand border. Using the 'x', 'y', 'z', or 'w' keystrokes, the user can select any three quaternion values of the current frame, omitting qx, omitting qy, omitting qz, omitting q0, respectively. 'w' restores the default "pure vector" projection.

Help summary: result of pressing "h" key:

Help
----

[Mouse]
  LEFT    : x-y rotation
   +SHIFT : change views along the quaternion curve
  MID     :  z  rotation
  RIGHT   : world rotation
  L+M     : world x-z translation

[Keyboard]
  'h'     : this help
  'q'/ESC : quit
  't'     : toggle comet trail
  +/-     : comet trail length
  'a'     : toggle world axes
  'A'     : toggle viewing frame axes
  's'     : toggle wire sphere
  'p'     : toggle quaternion curve display
  'f'     : toggle frame-by-frame or keyframe-by-keyframe dot product
  'm'     : toggle marker on quaternion curve
  '['     : toggle quaternion curve 1st derivative
  ']'     : toggle quaternion curve 2nd derivative
  'k'     : add a keyframe
  'd'     : delete the previous added keyframe
  'v'     : toggle quaternion curve type
  'i'     : print out current quaternion
  'r'     : reset
  'c'     : clear keyframe/trail
  '1'     : no object
  '9'     : draw color cube
  '0'     : draw teapot
 '2-8'    : objects for other demos used in quaternion course

  'w'     : default: XYZ projection (omit q0)
  'x'     : WYZ projection (omit qx)
  'y'     : WXZ projection (omit qy)
  'z'     : WXY projection (omit qz)


Back to Home page.