CLUquaternion Struct Reference

Defines a quaternion (x, y, z, w). More...

#include <clu.h>


Data Fields

GLfloat x
GLfloat y
GLfloat z
GLfloat w


Detailed Description

The CLUquaternion struct defines a quaternion. Quaternions are often used to describe a rotation about an arbitrary axis. This struct cannot be passed directly to OpenGL. Rather, when a quaternion rotation is required, it can be used to create a rotation matrix that can be passed directly to OpenGL.

Example

  CLnormal axis;
  GLfloat angle;
  CLUquaternion quaternion;
  CLmatrix matrix;

  cluSetNormal(&axis, 1.0f, 1.0f, 0.0f);
  cluNormalNormalise(&axis);
  angle = 75.0f;
  cluSetQuaternionAxisAngle(&quaternion, &axis, angle);

  ...

  cluSetMatrixOrientation(&matrix, &quaternion);
  glMultMatrix((GLfloat*)&matrix);
  

Definition at line 178 of file clu.h.


Generated on Thu Dec 27 13:53:42 2007 for CLU by  doxygen 1.4.6