-
Problem with Perspective
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
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 );
}
-
Junior Member
Regular Contributor
Re: Problem with Perspective
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).
-
Re: Problem with Perspective
Thanks now it is working.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules