# SetCameraRange

## Description

Sets the near and far planes of the camera. Due to rendering limitations not everything in front of the camera can be rendered so they must be limited to a visible range. Anything outside this range is clipped by the rendering system and is invisible. The near plane is the closest that an object can be to the camera and still be rendered, it must be greater than 0. Note that using very small values for the near plane will affect the accuracy of the depth buffer when rendering objects far away which might cause flickering on far away objects. This is because the depth buffer is not linear, instead it is skewed towards the near plane and the closer to 0 the near plane becomes the less of the depth buffer is available for far objects. The far plane is the maximum distance an object can be from the camera and still be rendered, it's maximum value is infinity but again the further you try to render an object from the near plane the less accurate depth buffering becomes. If an object crosses the near or far plane so that part of it is on one side and part is on the other the object will be cut by the plane and only the part within the view range will be visible. The default range is near=1, far=1000.

## Definition

SetCameraRange( cameraID, fNear, fFar )

void agk::SetCameraRange( UINT cameraID, float fNear, float fFar )

## Parameters

- cameraID - The ID of the camera to modify, the main camera is ID 1.
- near - The nearest that an object will be rendered.
- far - The furthest that an object will be rendered.