PDA

View Full Version : Problem with Perspective



Steve_7
07-21-2001, 08:11 PM
Hi I have problem with setting up perspective. Although, I use the following func. seems like I am getting glOrtho with dimensions x, y and z from -1.0f to 1.0f http://www.opengl.org/discussion_boards/ubb/frown.gif Any idea?

void DRAW :: SetUP_Environment (int w, int h){
glEnable( GL_DEPTH_TEST );
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(10.0f,(GLfloat)w/(GLfloat)h, 0.1f, 1000.0f);
glMatrixMode(GL_MODELVIEW);
gluLookAt( Cam_X, Cam_Y, Cam_Z, 0, 0, 0, 0, 1, 0 );
}

T2k
07-22-2001, 01:00 AM
void gluPerspective(
GLdouble fovy, //try 90deg not 10
GLdouble aspect,
GLdouble zNear,
GLdouble zFar
);

Parameters
fovy
The field of view angle, in degrees, in the y-direction.
aspect
The aspect ratio that determines the field of view in the x-direction. The aspect ratio is the ratio of x (width) to y (height).
zNear
The distance from the viewer to the near clipping plane (always positive).
zFar
The distance from the viewer to the far clipping plane (always positive).

Steve_7
07-22-2001, 12:22 PM
Thanks now it is working.