PDA

View Full Version : Perspective view in flight simulators.



robert_s
02-01-2002, 04:48 PM
HI!
I am just wonderring what the fovy value and other parameters in glPespecitve() should be set to? in order to achieve not very wide view and also see things in realistic dimensions.

For instance in my little flight sim I set it to 65.0 ie.
gluPerspective(65.0, (GLfloat) winWidth/(GLfloat) winHeight, 0.1, TERRAIN_LENGTH*4);

which appears to be ok because it doesn't distort the the scene by the edges (this happens if fovy=120.0) of the window. But.. the only one problem I have is the camera view angle which is very wide, I can almost see my whole terrain standing on one of its corners.
Now! if I set the fovy to a smaller value then everything becomes bigger and the whole scene is zoomed-in which means that everything appears to be bigger and closer to the camera even though it stays in exactly same place as previously. The only thing is that the camera view angle is slightly narrower. This is what I want to achieve ie. narrow angle view but I dont want to see things as they were zoomed-in ie. closer to me.

I'll give another example to make sure everybody knows what I am writing about.

I magine I set initially the perspective view to : gluPerspective(65.0, (GLfloat) winWidth/(GLfloat) winHeight, 0.1, TERRAIN_LENGTH*4);
which looks ok when looking at say mountains on the other side of hte river. but.. the angle view is to wide, so therefore I took a sheet of paper
made a small hole in the middle of the paper and looked thgough it again at those mountains on the other side of the river. looking through the gap I dont see mountains zoomed-in. they appear to have the same size and are at the same distance but just the angle view changes to a very narrow. basically with this angle I can only see a part of a big mountain where prevoiusly I could see all mountains and the whole river. This is exactly what I want to achieve!
Any ideas?



[This message has been edited by robert_s (edited 02-01-2002).]

Tron
02-01-2002, 08:16 PM
this is exactly the what fov does: zooming (ever played quake? try 'fov' in the console)

the normal value for fov is 90 degree
smaller values zoom in, larger values zoom out

i tested this in my terrain-engine-test:
www.uni-karlsruhe.de/~za2279/files/gl.zip (http://www.uni-karlsruhe.de/~za2279/files/gl.zip)
use Q and E to zoom