rotating stuff in OpenGL using quaternions

Started by
12 comments, last by HermanssoN 15 years, 1 month ago
Quote:Original post by HermanssoN
It's the normal glRotatef, so i gues radians.

So, basically, you're using a function without knowing what parameters it takes? Knowledge is better than guesses, so check some documentation.
Advertisement
Quote:Original post by Brother Bob
Quote:Original post by HermanssoN
It's the normal glRotatef, so i gues radians.

So, basically, you're using a function without knowing what parameters it takes? Knowledge is better than guesses, so check some documentation.


Well yes...I just asumed radians was a standard.

I also asumed it after reading this:
Quaternion to Axis Angle

To change a quaternion to a rotation around an arbitrary axis in 3D space, we do the following:

If the axis of rotation is (ax, ay, az)
and the angle is theta (radians)
then the angle= 2 * acos(w)

ax= x / scale
ay= y / scale
az= z / scale

where scale = sqrt (x2 + y2 + z2)

from a GD article, Quaternion powers, http://www.gamedev.net/reference/articles/article1095.asp

But again thanks for your time
So did adding the conversion fix the problem?
I't sure did.

I learnt that quaternions can't be rotated several revolutions. That's why I got the messed up rotation instead of a very slow one.

This topic is closed to new replies.

Advertisement