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.

Author
Message
davidt
23
Years of Service
User Offline
Joined: 29th Apr 2003
Location: United Kingdom
Posted: 18th May 2003 18:14
Does anyone know the default camera fov in degrees (vertical and horizontal) in darkBASIC pro? I need to know what the field of view is in both vertical and horizontal directions. Are the vertical and horizontal directions the same?

David
Spec - Abit NF7-S nForce 2, AMD Athlon 2100+, 256Mb PC2700, ATI Radeon 9000Pro, 20Gb Seagate U6, DVD-ROM, Zip 100, 15" TFT monitor
Shining Moonblade
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 18th May 2003 18:57
The tutorial on the site says that the default value is 69.9621.

To calculate what the FOV should be, the equation is:

tan(angle) = (h / 2) / d

h is the height of the screen in pixels.
d is either depth or the width of the screen in pixels.
The angle is half of the FOV necessary.

I hope this helps.

Watashi no namae wa Zeroshin desu! Hashitekudasai!
davidt
23
Years of Service
User Offline
Joined: 29th Apr 2003
Location: United Kingdom
Posted: 18th May 2003 20:49
So, to find out an angle from the camera, going through the mouse position, I would be able to use this. For example, if the mouse was at the center of the screen, the projected angle would be the same as the camera angle, but if the mouse was at the top of the screen, the projected angle would be slightly steeper than the camera angle.

To find the projected angle (vertically), I think I would do the following:

angle=(70/screen height())*mousey()

70 is the camera fov (69.9621 is about 70). This would need some extra adjustment using the actual camera angle, but I think this is about right.

The only problem was, I tried this, and all it gave was 0. I am pretty sure I am right, or I could be being very stupid, so can someone please check this?

Thanks, David

Spec - Abit NF7-S nForce 2, AMD Athlon 2100+, 256Mb PC2700, ATI Radeon 9000Pro, 20Gb Seagate U6, DVD-ROM, Zip 100, 15" TFT monitor
sicjoshsic
23
Years of Service
User Offline
Joined: 8th May 2003
Location: United Kingdom
Posted: 18th May 2003 23:40
in dbc it tell you the exact equation:
3.902/2.198
(or something similair)

Login to post a reply

Server time is: 2026-07-11 22:25:16
Your offset time is: 2026-07-11 22:25:16