Function _IrrSetCameraTarget

au3Irr2

au3Irr2 Function Reference

_IrrSetCameraTarget

Sets the point in space that the camera is looking at.

#Include <au3Irrlicht2.au3>
_IrrSetCameraTarget($h_Camera, $f_CamX, $f_CamY, $f_CamZ)

 

Parameters

$h_Camera Handle of a camera object
$f_CamX, $f_CamY, $f_CamZ Position in the scene to target with the camera.

 

Return Value

Success: True
Failure: False

 

Remarks

The camera view point can be moved by simply using the _IrrSetNodePosition function but this operation will change the point that the camera is pointing at.

 

Related

_IrrGetCameraTarget, _IrrSetCameraUpAtRightAngle, _IrrSetCameraUpDirection, _IrrGetCameraOrientation, _IrrGetCameraUpDirection

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

; set up a sphere into the scene:
local $nodeSphere = _IrrAddSphereSceneNode(5)
_IrrSetNodeMaterialTexture( $nodeSphere, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0)
_IrrSetNodeMaterialFlag( $nodeSphere, $IRR_EMF_LIGHTING, $IRR_OFF )
_IrrSetNodePosition($nodeSphere, 10, 5, 10)

local $nodeCamera = _IrrAddFPSCamera()

; target the sphere with the camera:
_IrrSetCameraTarget($nodeCamera, 10, 5, 10)

WHILE _IrrRunning()
    _IrrBeginScene(0, 0, 25)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()