[bb] Set Camera FOV by sswift [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:39

Previous topic - Next topic


Title : Set Camera FOV
Author : sswift
Posted : 1+ years ago

Description : This simple function sets the horizontal FOV of the specified camera.

Now you can set your camera to have an FOV of exactly 90 degrees for rendering cubic environment maps.  Yay!

Code :
Code (blitzbasic) Select
Function SetCameraFOV(Camera, FOV#)
   CameraZoom Camera, 1.0 / Tan(FOV#/2.0)
End Function

Comments :

RexRhino(Posted 1+ years ago)

 Just in case anyone is looking through the code source looking for a function to generate sky boxes from 3D scenes created in Blitz3D, this is what you would use.