[Plib-users] quaternion routines work ?
Brought to you by:
sjbaker
From: Oliver B. <sh...@ih...> - 2000-04-10 04:18:22
|
Has anyone actually got the quaternion routines working using them ? Using the below code when I hold the up key down then It "bouncing" up and down on a very small angle ... I am using the cvs version here ... using the 1.1.11 rotation round y worked but round x and z caused the whole model to become really warped as I rotated round ... but at least it worked better than I get now .. void Camera::Rotate(float x, float y, float z) { sgNormalizeQuat (rotation) ; sgRotQuat(rotation, -x, 1.0f, 0.0f, 0.0f); sgRotQuat(rotation, -y, 0.0f, 1.0f, 0.0f); sgRotQuat(rotation, -z, 0.0f, 0.0f, 1.0f); } for dislplaying a cube... glLoadIdentity(); sgMakeRotMat4(rotationmat, rotation); glLoadMatrixf((float*)rotationmat); glTranslatef(position[0], position[1], position[2]) show cube etc... thanks, Oliver Batchelor |