Original Post
alright in my program it started out using an ortho view but when i try to convert it to a perspective view, my scene doesnt show up where it should be on screen. here is my function
void ChangeSize(int w, int h)
{
GLfloat FAspect,
nRange= 150.0f;
// Prevent a divide by zero
if(h == 0)
h = 1;
// Set Viewport to window dimensions
glViewport(0, 0, w, h);
FAspect = (GLfloat)w / (GLfloat)h;
// Reset projection matrix stack
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0f,FAspect,-500.0f,500.0f);
/*
// Establish clipping volume (left, right, bottom, top, near, far)
if (w <= h)
glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange, nRange);
else
glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange, nRange);
*/
// Reset Model view matrix stack
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
|