Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  What is the field of view in gluPerspective?  (Read 8204 times)
0 Members and 1 Guest are viewing this topic.
Offline SHC
« Posted 2013-09-13 13:44:10 »

I'm trying to learn perspective projection in LWJGL with
function. I know to use
to create perspective projections but haven't clearly understood what field of view (fov) which is the first parameter of
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
is advantageous over

Offline Slyth2727
« Reply #1 - Posted 2013-09-13 13:48:48 »

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 :/.

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Offline xsvenson
« Reply #2 - Posted 2013-09-13 14:19:44 »

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

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SHC
« Reply #3 - Posted 2013-09-13 14:21:34 »


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

Offline sproingie

JGO Kernel

Medals: 202

« Reply #4 - Posted 2013-09-13 16:52:58 »

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
.  If you're already expert with glFrustum, you don't need gluPerspective, as it's simply a convenience wrapper over glFrustum.
Offline Cero
« Reply #5 - Posted 2013-09-13 17:33:24 »

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

Click to Play

Offline SHC
« Reply #6 - Posted 2013-09-14 05:34:24 »

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
to denote
field of view on the y axis

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

Offline sproingie

JGO Kernel

Medals: 202

« Reply #7 - Posted 2013-09-14 16:29:47 »

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.

Offline xsvenson
« Reply #8 - Posted 2013-09-17 13:39:18 »

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

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Offline ClickerMonkey

JGO Coder

Medals: 20

Game Engineer

« Reply #9 - Posted 2013-09-17 14:29:03 »

I will try to improve myself in the future


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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SHC
« Reply #10 - Posted 2013-09-17 14:56:34 »


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

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

Offline Several Kilo-Bytes

Senior Devvie

Medals: 11

« Reply #11 - Posted 2013-09-19 14:23:52 »

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.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (60 views)
2015-11-07 13:29:08

Rems19 (73 views)
2015-10-31 01:36:56

Rems19 (65 views)
2015-10-31 01:32:37

williamwoles (102 views)
2015-10-23 10:42:59

williamwoles (88 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (129 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (150 views)
2015-10-11 13:26:18

BurntPizza (164 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!