DarkBASIC Professional Help File

DX11 CREATE CAMERA

Creates a new camera used for rendering your scene from a certain perspective.
Take note that you can only have up to 32 unique cameras at any one time (this includes the main camera
which always exists). The reason for this is simply so that you can represent all possible cameras in
a 32-bit bit mask as is used to set certain objects / limbs to only be rendered by certain cameras instead of all of them.
The same approach is also used with the sync mask, which determines which cameras are automatically rendered to
when you call DX11 SYNC.
All parameters are optional and can be set at a later time through other functions.

Syntax

    Return Dword = DX11 CREATE CAMERA([near], [far], [fov], [aspectRatio])

Parameters

    [Optional] near

> Float
> The near distance of the camera. Any geometry closer to the camera than this will be clipped (not drawn). Defaults to 1.0.

    [Optional] far

> Float
> The far distance of the camera. Any geometry farther away from the camera than this will be clipped (not drawn). Defaults to 3000.0.

    [Optional] fov

> Float
> The field of view of the camera in degrees. Defaults to 61.9621353149.

    [Optional] aspectRatio

> Float
> The aspect ratio of the camera. You should set it to the width / height of what you intend to project onto. Defaults to screenWidth / screenHeight.

Returns

The created camera. Will return 0 if you are trying to create more than 32 cameras at the same time.

See also

CAMERA Functions Menu
DX11 Function Categories