Reputation: 73
I followed the question here 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()?
Upvotes: 0
Views: 2780
Reputation: 7312
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.
Upvotes: 3
Reputation: 25750
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)
Upvotes: 3