Ok so I've these lines of code:
Code
GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window
{
if (height==0) // Prevent A Divide By Zero By
{
height=1; // Making Height Equal One
}
glViewport(0,0,width,height); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
glRotatef(0.0f,0.0f,0.0f,0.0f);
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,1.0f,100.0f);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity(); // Reset The Modelview Matrix
}
Later in the code, i'm displaying a cube with textures. As of now, it is a front view of the cube, but I want it to be an isometric view. So I tried changing the green line to:
Revised Code
glRotatef(45.0f,1.0f,1.0f,0.0f);
I changed that thinking that since the parameters go like (angle,xrot,yrot,zrot) that would rotate both the x and the y axis 45degrees.
Is there problems with my code or what is going on? If you want pictures of what i've going on I'll upload them.
None.
Nobody on sen does openGL....
I guess a mod can close this, and if anyone actually knows the answer, you can just pm me.
None.
I changed that thinking that since the parameters go like (angle,xrot,yrot,zrot) that would rotate both the x and the y axis 45degrees.
The parameters are not (angle,xrot,yrot,zrot), they are (angle, x, y, z) where x, y and z define a vector to rotate around.
None.
I changed that thinking that since the parameters go like (angle,xrot,yrot,zrot) that would rotate both the x and the y axis 45degrees.
The parameters are not (angle,xrot,yrot,zrot), they are (angle, x, y, z) where x, y and z define a vector to rotate around.
Oh sorry I think those were the variables I set them as? So any guesses why it isn't functioning?
None.