View Full Version : different glRotatef use
Will this rotate about the y-axis by 60 degrees
and 30 degrees around the x-axis?
is this equivalent to:
11-07-2007, 01:17 PM
No and no.
It will rotate 60 degrees around the axis defined by the vector (0.5f, 1.0f, 0.0f).
[ www.trenki.net (http://www.trenki.net) | vector_math (3d math library) (http://www.trenki.net/content/view/16/36/) | software renderer (http://www.trenki.net/content/view/18/38/) ]
I want to have my engine set 3 rotational values for each object.
So shouldn't these rotations be performed in one step, ie around the global x,y,z axis?
Or would I have to call
and then work out what vector will represent the global y axis
and then call
glRotatef(roty,myCalculated axis vector)
and then calculate a vector which will represent the global x axis?
11-08-2007, 08:07 PM
OpenGL will compose the rotation matrices you specify into a single one under the hood, so you shouldn't have a problem as long as you don't hit gimbal lock.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.