Jump to content

Set Fov and Set Fog!


Gilmer
 Share

Recommended Posts

Hello, im with the following doubt, in editor, in main properties, i can set the camera fov. But when i make the program in c++, has none command that i can are setting the fov. I searched in wiki and in the forum, but i not found nothing. How i can make this? The same problem occurs with the fog, i dont found any commando for this..

Link to comment
Share on other sites

i think is not, or i doing wrong..hehehe

for sample, in editor, i set the FOV to "115", but if i use the CameraZoom, what value which i need set? I put "CameraZoom(camera,115)", it show a zoom very long, but if i put "CameraZoom(camera,-115)", the image is inverted.

Link to comment
Share on other sites

i think is not, or i doing wrong..hehehe

for sample, in editor, i set the FOV to "115", but if i use the CameraZoom, what value which i need set? I put "CameraZoom(camera,115)", it show a zoom very long, but if i put "CameraZoom(camera,-115)", the image is inverted.

 

You are doing it wrong. ;) According to Josh: The default FOV is 90 degrees, meaning you have a width of view that sees 90 degrees. Zoom zooms in, so zoom=2.4 should give a 45 degree FOV. Then the zoom for any FOV can be calculated as follows:

 

zoom=1.0/Tan(fov/2.0)

 

so a FOV of 115 would be CameraZoom(camera, 0.637)

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

With some searches, i found in the old forum, the following formule:

 

fov = 115;
zoom = 1.0/tan(fov/2.0);

 

but, no documentation wiki, dont have nothing talking about this...and is this which is working. I use this with the CameraZoom.

Link to comment
Share on other sites

That is weird because I cannot get that formula that you both wrote to work. Instead, I found this formula work:

 

flt zoom=0.0;
flt fov=90;
zoom = 1.0 / tan(fov*3.14159265/360);

 

I tried this because I modified a formula I found here to work with the camera zoom.

Like macklebee mentioned, the default FOV is 90 degrees. The other formula says 45 degrees is the default and multiplying that with PIE then dividing that with 180 will give 1.000. I basically took that and made 180=360 because 360/4=90 whereas 180/4=45. It makes sense there, but I cannot figure out why you guys are getting your formula to work and I cannot. Anyway, at least I found this formula to work.

Play Our Latest Game: Relic Rogue

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...