#include <clu.h>
Data Fields | |
GLfloat | x |
GLfloat | y |
GLfloat | z |
GLfloat | w |
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.
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.