View Full Version : Quaternion woes...

05-01-2001, 08:44 AM
Abandoning my linearly algebreaic ways, I've jumped on the Quaternion bandwagon in the hopes of making a Camera-actor system I can actually understand. Plus, I'm trying to develope it into a portable library so that when I do a (ghasp) D3D renderer, I don't have to do quite as much work.

Anyways, I ran into a snag. I actually have the quaternion class implemented, and yes, it actually works, the first time around. Not bad for 3 hours I'd say (props to Sobeit Void for the article on GameDev). Here's the problem. The rotation looks to be kindof strange. It rotates in the opposite direction of what it should, plus it also does a 180 degree rotation as well each frame. So the hold image flickers, and has what appears to be a 180.5 degree rotation each frame.

Any ideas?


05-01-2001, 08:57 AM
Whoops... nevermind. I found my error. When converting from axis-angle, I was dividing the vector axis by the sine angle, rather than multiplying.

Everything rotates in the right directions now, and now, hopefully, I can work on the actual camera.

BTW: Once I get this library done, I'll try and get it posted for everyone to enjoy.