Camera class with Quaternions (yeah, I know)

Started by riflemon, February 21, 2004, 16:24:35

Previous topic - Next topic

riflemon

I've got a classic camera class using Quaternions. I keep as state a Vector for the camera's position and a Quaternion for the orientation.
I define the reference (static) UVR vectors as AXIS_Y, AXIS_Z and AXIS_X respectively.

I expose yaw, pitch, and roll methods that take an angle as the param in.
For each of these, I build a quaternion from an AxisAngle, using (orientation.operate(AXIS) ) on each.

My problem is this: once I've already tilted the camera on one axis, any movement on another axis is like an arc movement spanning a different axis (it's difficult to explain). It's as if I was using the original(non rotated) UVN vectors instead of the regular ones. Anybody has experienced this? Could my quaternion be getting corrupted data along the way?

Thanks in advance for any and all feedback (this is driving me nuts).
oding from always warm, always sunny Rosario, Argentina :D