PDA

View Full Version : gluperspective perameters



ninjarider
08-16-2005, 09:19 AM
im using the gluperspective function and the objects i draw dont look realistic. im trying to make a simulator and a door thats suppose to be 7 feet high by 3 feet looks like a door thats 10 feet high and 1 foot wide.
gluperspective 54, width / height, .1, 15000

whats a more realistic set of perameters i can use

Hlz
08-16-2005, 09:46 AM
Are width and height floats for the divide?

If you want to look through your monitor, like a virtual window into the world, some simple trig will get you an appropriate fov to use, given a typical eye distance from the screen.

Watch zNear and zFar, don't hose your depth buffer. Try zNear = 1?

ninjarider
08-16-2005, 10:39 AM
width and height is the pixel width and height of the screen.

as far as the number 45 in the gluperspective function. i have no clue what its suppose to mean or what it does

memfr0b
08-16-2005, 10:55 AM
Originally posted by ninjarider:
width and height is the pixel width and height of the screen.Just make sure they are floating point values. I not, you will get an integer division, which means your aspect ration will not contain the fractional part of the division result.


as far as the number 45 in the gluperspective function. i have no clue what its suppose to mean or what it doesIt is the Field of View of your view frustum in y direction. The vertical opening angle of your camera.

ninjarider
08-17-2005, 06:00 AM
is the angle of the camera view to be concidered from ground level up or is it the full radius of the angle

memfr0b
08-17-2005, 06:07 AM
The full angle between the upper and lower planes of the view frustum.

Hlz
08-17-2005, 08:12 AM
If you're really interested, you can get more info here:
http://pyopengl.sourceforge.net/documentation/manual/gluPerspective.3G.html
http://www.rush3d.com/reference/opengl-redbook-1.1/chapter03.html