[Plib-devel] Quaternion Usage Question
Brought to you by:
sjbaker
From: Negative0 <neg...@ea...> - 2000-02-22 07:18:38
|
I have seen demos of Quaternions where rotation by an axis uses a more logical view point axis than the actual objects axis for rotation. I can't find any guides on how to use the simple geometry quaternion routines so I have tried the following: sgMakeIdentQuat( &Q ); sgRotQuat( &Q, 90.0, 1.0, 0.0, 0.0 ); At this point I have tried using: sgMakeRotMat4( rotation, &Q ); sgXformVec3( point, rotation ) and: sgMakeRotMat4( rotation, &Q ); glMultMatrixf( rotation ) as well as: sgQuatToAngleAxis(...) glRotatef(...) These don't produce any meaningful output. One combination I made actually rotated the 90 along the X axis, but drifted 30 degrees along the Z axis as well. I would greatly appreciate any examples, pointers, or descriptions on how to properly setup, rotate, and use the quaternion transformations. Thanks in advance, -negative0 |