PDA

View Full Version : viewing problem...



glguy
04-29-2006, 06:54 AM
Hi,

I've currently created a map in openGL, but for some reason it always appears to be slightly slanted. Does anyone know why could this happen?

Here's a sample of my initialising code.


void MainGLCanvas::doInit() {
glEnable(GL_TEXTURE_2D);
LoadGLTextures();
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); // Reset The Projection Matrix
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();

}

Ehsan Kamrani
04-29-2006, 02:13 PM
After this part:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
I guess you want to specify a view volume. Isn't it?I can not see any functions to set the view volume in your code--gluPerspective, glOrtho,etc .
-Ehsan-

glguy
04-30-2006, 10:09 AM
Hi,

I've tried using glOrtho(xmin, xmax, ymin, ymax), however my 2D map is still slanted. Any help would be very much appreciated. thanks