Introduced in

Version:3.7

Description

Description:

Sets a camera's view frustum.
Identical to setCamFrustum, but the effect is only applied to the specified camera.

All parameters are given as tangents of angles, going from the center of the camera direction.

Syntax

Syntax: camera camSetFrustum [custom, width, height]
Parameters:
  • camera: Object - Camera whose frustum to modify (can be an RTT cam). If set to false, resets frustum.
  • custom: Boolean - If set to false, resets frustum.
  • width: Number - Changes only the FOV if height isn't set.
  • height: Number - Changes the aspect ratio when set with width. (Optional)
Return Value: Boolean - Set to true if command succeeded.

Alternative Syntax

Syntax:camera camSetFrustum [custom, left, right, bottom, top]
Parameters:
  • camera: Object - Camera whose frustum to modify (can be an RTT cam). If set to false, resets frustum.
  • custom: Boolean - If set to false, resets frustum.
  • left: Number - Sets left side angle of frustum.
  • right: Number - Sets right side angle of frustum.
  • bottom: Number - Sets bottom side angle of frustum.
  • top: Number - Sets top side angle of frustum.
Return Value:Boolean - Set to true if command succeeded.

Examples

Examples: Sets FOV width to 60 degrees from center of camera direction to both sides (120 degrees total), height is adjusted so aspect ratio is kept.
cam1 camSetFrustum [true, tan 60]
Sets FOV width to 50 degrees total (25 degrees from center of camera direction to both sides):
cam1 camSetFrustum [true, tan (50/2)]
Resets the camera frustum to default view:
cam1 camSetFrustum [false]

Additional Information

See also: camFrustum, setCamFrustum
Multiplayer: 
Problems: 

Notes