Graphics.CameraWithFixedFieldOfView - lordmundi/wikidoctest GitHub Wiki
Camera with Fixed Field of View
« Limit Parameters Of A Node | EDGE User’s Guide | Adding Reflection »
Two methods, both of which get more messy if you want to use an aspect ratio other than 1.3333:
Method 1 (preferred):
- Assign a camera type to the camera definition in the config file. This is done via the "TYPE()" attribute. Camera types are defined in a seperate "CAMERAS" block. The bottom of userdata/configs/user_models.cfg has some examples.
- Calculate the VFOV that corresponds to the HFOV you want. The VFOV is calculated by scaling the half-tangent of the HFOV by the aspect ratio. See this article for the equation to perform the conversion.
- Define the type to have the same number for near FOV as far FOV making the zoom unchangeable.
Method 2:
- Add the "show( FOV );" attribute to the camera definition in the config file, as explained here.
- Run the graphics, assign the camera, and zoom the camera in an out until the desired HFOV is reached. Write down the zoom factor from the camera edit dialog.
- To fix the camera at this FOV, create a tcl script file that limits the zoom for the camera to the factor determined above, and add the script to the GUI block. You can find the syntax for the limit command here.
« Limit Parameters Of A Node | EDGE User’s Guide | Adding Reflection »