It seems that i dont fully comprehend how rotation works. So leys say i have a cube and i do this:
x = 90.0f;
rotatef(x, 1.0f, 0.0f, 0.0f);
Notice that my code here may be not all correct, its like that just to symbolize what i mean.
So by doing that i would be facing the Top of the cube. But in this tutorial: http://nehe.gamedev.net/tutorial/moving_bitmaps_in_3d_space/17001/
it states that by doing something like that, its like rotating the whole room so now X axis goes out or into the screen and Z axis is right or left. So its basically the part i dont get, like the guy in tutorial explains, why does the room rotate to the right side? For better understanding this a part from the tutorial:
int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glBindTexture(GL_TEXTURE_2D, texture[0]); // Select Our Texture
for (loop=0; loop<num; loop++) // Loop Through All The Stars
{
glLoadIdentity(); // Reset The View Before We Draw Each Star
glTranslatef(0.0f,0.0f,zoom); // Zoom Into The Screen (Using The Value In 'zoom')
glRotatef(tilt,1.0f,0.0f,0.0f); // Tilt The View (Using The Value In 'tilt')
"Now we move the star. The star starts off in the middle of the screen. The first thing we do is spin the scene on the x axis. If we spin 90 degrees, the x axis will no longer run left to right, it will run into and out of the screen. As an example to help clarify. Imagine you were in the center of a room. Now imagine that the left wall had -x written on it, the front wall had -z written on it, the right wall had +x written on it, and the wall behind you had +z written on it. If the room spun 90 degrees to the right, but you did not move, the wall in front of you would no longer say -z it would say -x. All of the walls would have moved. -z would be on the right, +z would be on the left, -x would be in front, and +x would be behind you. Make sense? By rotating the scene, we change the direction of the x and z planes."
P.S why do even need to shift everything by 90? Since in the tutorial we undo this anyways. I get why we need to undo it but dont know why we need to do it in the first place.