Function _IrrSetCameraClipDistance

au3Irr2

au3Irr2 Function Reference

_IrrSetCameraClipDistance

Defines far and near distances for camera clipping

#Include <au3Irrlicht2.au3>
_IrrSetCameraClipDistance($h_Camera, $f_Distance, $f_NearDistance = 1.0)

 

Parameters

$h_Camera Handle of a camera node
$f_Distance Defines the far distance for clipping
$f_NearDistance [optional] Defines the near distance for clipping (towards the camera)

 

Return Value

Success: True
Failure: False

 

Remarks

The clipping distances of a camera are the distances beyond and before which no triangles are rendered. Default clipping is before 1.0 and behind 2000.0.
This speeds the scene up by not showing geometry that is beyond or before the defined distances and increases rendering performance without requiring you to manage adding and deleting the objects from the view.
To make the far distance clipping less abrupt you can use it in combination with _IrrSetFog.

 

Related

_IrrAddCamera, _IrrAddFPSCamera, _IrrSetFog

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

local $nodeCube = _IrrAddCubeSceneNode(12)
_IrrSetNodeMaterialTexture( $nodeCube, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0)
_IrrSetNodeMaterialFlag( $nodeCube, $IRR_EMF_LIGHTING, $IRR_OFF )

local $nodeCamera = _IrrAddCamera(10, 10, 10, 0, 0, 0)
_IrrSetCameraClipDistance($nodeCamera, 15)

WHILE _IrrRunning()
    _IrrBeginScene(50, 50, 50)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()