What is the field of view in gluPerspective?

I’m trying to learn perspective projection in LWJGL with [icode]gluPerspective[/icode] function. I know to use [icode]glFructum[/icode] to create perspective projections but haven’t clearly understood what field of view (fov) which is the first parameter of [icode]gluPerspective[/icode] function. Most tutorials I’ve visited on the net set it to a fixed value ranging from 0 to 90 but none gave a clear explanation. Can anybody explain it clearly? Also why [icode]gluPerspective[/icode] is advantageous over [icode]glFructum[/icode]?

Well from what I recall I programmed it into my Matrix class for my camera. I’m in class right now but I’ll look at my code when I get home in the afternoon.About gluPerspective I honestly have no clue though sorry :/.

90 = 90 degrees where 360 is the fully surround viewport.

@xvenson

Can you explain further? I didn’t understand what you said.

The field of view is describes the size of the rectangle that fills your entire field of vision top to bottom. If you imagine you’re looking at a rectangle some fixed distance away, draw a line from your eye to the top of the rectangle and another to the bottom. The angle between those lines is the FOV. 90 degrees is a pretty common FOV, though it’s often narrowed temporarily for a sense of speed, and some shooters crank it up higher to simulate a sense of peripheral vision (I commonly have it set >100 in Borderlands 2).

Also, it’s [icode]glFrustum[/icode]. If you’re already expert with glFrustum, you don’t need gluPerspective, as it’s simply a convenience wrapper over glFrustum.

its basically how much an observer can see to the sides
looking through toilet paper rolls, having a hoodie on, or standing free without obstacles for example

lets look at some examples and diagrams

Example of freaking 170 fov
CoD Example

http://withfriendship.com/images/h/36083/the-fov-in-mirror.gif

So, it’s the angle between the lines drawn from the eye center to the top and bottom sides of the near plane in perspective vision like this?

If this is the actual thing, I am confused with the diagram shown in a video tutorial. Seems the Red Book defined as [icode]fovy[/icode] to denote [icode]field of view on the y axis[/icode]

Thanks for clearing out my doubt. And I preferred [icode]glFructum[/icode] since it directly takes the screen positions like the [icode]glOrtho[/icode] function. Which of those do you recommend for newbies who are coming from orthographic 2D background?

Yeah, even though FOV in a game tends to have the most dramatic effect on lateral vision, it’s still defined in gluPerspective as being on the Y axis, which is traditionally top to bottom (could be whatever you want, but defaults are what they are). You then stretch it out horizontally with the aspect parameter. Bit weird, but you get used to it.

gluFrustum gives you more control and you pretty much have to use it instead of gluPerspective when dealing with stereoscopic displays because the view frustum for each eye is not on a perfectly isosceles triangle. But for most uses, and especially for beginners, I still recommend gluPerspective.

Sorry.
My answer was written in a hurry and looking at it now, it was totally useless.
I will try to improve myself in the future

GOOD.

Also, to zoom in on FPS games you can simply decrease the FOV to 30deg or w/e

@ClickerMonkey

That’s a nice tip. I will try that in near future.

Also can you say me how to create 3d levels?

You’ve got to have some type of 3D rendering and 3D physics first. How you create levels depends on that. Voxels, height maps, free form static terrain, and free form destructable terrain all need different tools. Many games probably use a custom editor.