tags:

views:

316

answers:

2

I followed the question here http://stackoverflow.com/questions/764313/quaternion-math-for-rotation to get an angle of rotation and the axis around which I need to rotate, My question is how do I pass the angle and axis as an argument to glrotate()?

+2  A: 

If the axis is defined by the variables x, y, z, and the rotation angle is in the variable angle, then it's as simple as glRotatef(angle, x, y, z)

Firas Assaad
+2  A: 

The double version is

glRotated(angle,x,y,z)

The float version is

glRotatef(angle, x, y, z)

The angle must be in degrees, so convert it to degrees first if it is in radians.

Ewan Todd