Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Make Camera See Really Small Things?

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 14th Oct 2008 01:05
How do I make my camera smaller so it can see small things?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 14th Oct 2008 02:47
I doubt you can. You'd probably have to scale what you're looking at to be larger. But you really wouldn't be picking small details unless the image/object/texture was geared to be viewed that way.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 14th Oct 2008 03:53
dbSetCameraFOV ();

Use that command to make the Field Of View very small.

The default for the camera is 90Deg.
by making it 9Deg you get an approx 10x magnification .... etc.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 14th Oct 2008 05:25
No, the default is 360/7.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 14th Oct 2008 06:43
Quote: "No, the default is 360/7."


Sorry Zuka, I dont know where you got that information from but the documentation says
Quote: "
dbSetCameraFov
This command will set field of view for the camera given an Angle value. The default angle is the result of the calculation 360 degrees divided by four.
"


and the measurements I made from within my game confirm it to be 90 Deg as the default.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 14th Oct 2008 20:36
You're both wrong, the default is around 62.

SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 14th Oct 2008 20:42
So Zuka says the default is around 51.42, Sydbod says it is 90 as the documentation states, and Dark Coder says its 62.

LOL!

But I actually agree with Dark Coder, I have seen 62 thrown around tutorials quite a few times. This isn't the first typo I have spotted in the DGDK documentation.

www.Helios-Online.net
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 14th Oct 2008 22:00
Dark coder's right (no surprise there ), the default FOV isn't 90 or 45, after a little testing awhile back I found that it's 61.95. I've no idea why TGC chose this value, seems a bit random.

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 15th Oct 2008 00:08 Edited at: 15th Oct 2008 00:10
Whoops, yeah, it was 4. Don't know where I got 7. But yes, 360/4 is 90... uhhh... crap....

Oh well, me and Darkcoder were closest.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 15th Oct 2008 05:06 Edited at: 15th Oct 2008 05:10
OK here are the reasonably accurate results.

I set up the camera in my game to be stationary with only left/right panning enabled.
Had the camera Y rotation being displayed.
Panned the camera so that one point was displayed on left of screen and then on right of screen, with the difference in camera Y rotation representing the FOV.

Ran tests at 1024x768 as well as 1600x1200 to see if different screen resolutions changed the FOV in any way.

1024x768 FOV = 77.2Deg.
1600x1200 FOV = 77.4Deg.

They are both close enough (within probability of error for optically positioning objects on screen)

I do not know if FOV would be different with different screen aspect ratios .... some one else can try that.

If any one wants to dispute the default FOV being close to 77Deg then please provide your results and how you acquired them.

Yes the documentation that says 90Deg is not correct.

NOTE: These results are for the CURRENT DGDK and do not apply to other versions of the game library
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 15th Oct 2008 05:19
Quote: "If any one wants to dispute the default FOV being close to 77Deg then please provide your results and how you acquired them."


Here ya go. The FOV is not altered at the start so it starts at its default. Press the spacekey to change the FOV to 61.95, you'll notice just about no difference in the size of the cube. Then press the shift key to go to 77, and you'll notice a huge difference. Res is 1024 by 768.



sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 15th Oct 2008 05:56 Edited at: 15th Oct 2008 06:07
@ AndrewT,

That is strange.

Try this code


Move one corner of the cube to the left edge of the screen, and read the angle.
Move the exact same corner to the right of the screen and again read the angle .

Now calculate the FOV from the difference of the 2 angles.

EDIT: can it be that the "dbSetCameraFOV( )" function is actually faulty??????
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Oct 2008 06:16 Edited at: 15th Oct 2008 06:16
How would that calculate the FOV? You do realise the size of the object there/its distance to the camera will change when its corner reaches the edge of the screen. Try this:



When the centre of the object reaches one side you'll see that the FOV is indeed just under 62, or half of that as you're only calculating the one side. You could also extract the FOV from the projection matrix, though not directly.

sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 15th Oct 2008 06:47
@ dark coder,

dbSetCameraAspect( 1.0f ); distorts the geometry of the 3D space, unless one has a screen of W to H of 1 to 1. IE: a screen resolution of 1024x1024 . You can see this distortion in your code by looking at the cube and seeing it is no longer square but rectangular.

As we are running a screen resolution of 1024x768, (on a 4x3 display) the setting should be "dbSetCameraAspect( 1024.0f / 768.0f );" .
The cube is now square again and the FOV is around 77Deg again.

Of note, the game library will by default do this "dbSetCameraAspect( 1024.0f / 768.0f );" if a person does not do a "dbSetCameraAspect()" and the person is running at 1024x768 resolution.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Oct 2008 07:07
You clearly misunderstand why I did that. When a vertex is transformed into screen space using a perspective camera it uses 2 FOV values, the horizontal and vertical, or x and y axis ones. The FOV value you pass to a camera dictated the vertical FOV exactly, the horizontal FOV is the vertical FOV * the aspect ratio, this is why I set the aspect ratio to 1.0 so they both the same as your code used the x axis(in screen-space).

sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 15th Oct 2008 07:27
@ dark coder,

Quote: "The FOV value you pass to a camera dictated the vertical FOV exactly, the horizontal FOV is the vertical FOV * the aspect ratio, this is why I set the aspect ratio to 1.0 so they both the same as your code used the x axis(in screen-space)."


AHHHHH, thanks for that explanation.
I always wondered how that all tied together.

So if the FOV is set to 62Deg then that means the FOV in the height direction.
And if we have a screen resolution of 1024x768, then the FOV in the width direction would be 62*1024/768 = 82.6Deg.

My apologies for my ignorance about the proper terminology.
Another gem of knowledge has now been squirreled away at the back of my mind.

Login to post a reply

Server time is: 2024-11-18 03:09:03
Your offset time is: 2024-11-18 03:09:03