View Full Version : Perspective Projection

06-23-2001, 02:48 PM
Im trying to build a "house" made of cubes with two walls, a floor and a ceiling.

When I look at it the screen goes black until Im turning around a bit. (Im looking through the cube, so the walls, the floor and the ceiling are not visible because they appear to be "infinitely thin".

I guess thats a normal thing when I use orthographic projection, but when I change glOrtho to glFrustum (with parameters 0, 20, 0, 20, 10, 100) the projection still seem to be orthographic.

Have I forgotten something? Ive tried different values for "near" and "far" as well.

What I believe to happen while using perspective projection is that Ill be able to see both walls, floor and ceiling, just like a straight road gets narrower. Is this right?

Eber Kain
06-23-2001, 05:48 PM
try this
gluPerspective ( 45, ( GLdouble ) w / ( GLdouble ) h, 1.0, 2000.0 );