Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.30

Description

Description:

Sets the custom camera view frustum.

All cameras, including the player view and editor cameras are affected by this. All parameters are given as tangents of angles from center of camera direction.

Demo mission to test player and camera FOVs: chkFOV.zip

Syntax

Syntax:setCamFrustum [custom, width, height]
Parameters:
  • custom: Boolean - If set to false, resets the frustum.
  • width: Number - Changes only the FOV, if the height is not set.
  • height: Number - Changes the aspect ratio when set with width (optional).
Return Value:Boolean - Returns true, if the command succeeds.

Alternative Syntax

Syntax:setCamFrustum [custom, left, right, bottom, top]
Parameters:
  • custom: Boolean - If set to false, resets the frustum.
  • left: Number - Sets the left-side angle of the frustum.
  • right: Number - Sets right-side angle of the frustum.
  • bottom: Number - Sets bottom-side angle of the frustum.
  • top: Number - Sets top-side angle of the frustum.
Return Value:Boolean - Returns true, if the command succeeds.

Examples

Examples:
Sets the FOV width to 60 degrees from the camera center direction to both sides (120 degrees in total), height is adjusted, so that aspect ratio is kept:
setCamFrustum [true, tan 60];

Sets the FOV width to 50 degrees in total (25 degrees from camera center direction to both sides):
setCamFrustum [true, tan (50/2)];

Resets the camera frustum to default view:
setCamFrustum [false];

Effects of different camera frustrum settings:

Different off-center projections:

Additional Information

See also: camFrustum, setCamFrustumOffsets, camSetFrustum, camGetFov , opticsState, SetOpticsState
Multiplayer:
Problems:

Notes







Posted on Oct 27, 2010
Flyman
Before version 1.43, the parameters didn't specify the tangent of the camera angle, but only half of it. If you wanted to have 60 degrees FOV, you should set it to 'setCamFrustum [true,(tan (60/2)) * 2]'. This problem was solved in version 1.43.



Posted on Feb 01, 2011
Kronzky
In V1.40 any modified frustum is not automatically reset when the mission ends, make sure to reset it manually (via setCamFrustum [false]) when ending a mission (or a camera sequence).