Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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 4978 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
gluPerspective
function. I know to use
glFructum
to create perspective projections but haven't clearly understood what field of view (fov) which is the first parameter of
gluPerspective
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
gluPerspective
is advantageous over
glFructum
?

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 »

@xvenson

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


Thanks for clearing out my doubt. And I preferred
glFructum
since it directly takes the screen positions like the
glOrtho
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 »

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

“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

GOOD.

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 »

@ClickerMonkey

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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org 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‑gaming.org
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!