Function _IrrAddLight

au3Irr2

au3Irr2 Function Reference

_IrrAddLight

Adds a light node into scene to naturally illuminate your scene.

#Include <au3Irrlicht2.au3>
_IrrAddLight($h_parentNode, $f_X, $f_Y, $f_Z, $f_Red, $f_Green, $f_Blue, $f_Size)

 

Parameters

$h_parentNode Handle of the node to attach the light to.
$IRR_NO_PARENT attaches to the root node of the scene.
$f_X, $f_Y, $f_Z Coordinates of the light in the scene
$f_Red, $f_Green, $f_Blue Intensity of the light.
Red/green/blue are fractional values from 0 to 1!
$f_Size Radius of effect of the light

 

Return Value

Success: Handle of light node in the scene
Failure: False

 

Remarks

When using shadows you probably only want one or two lights - they can be time consuming.

 

Related

_IrrAddNodeShadow, _IrrSetAmbientLight

 

Example


#include "au3Irrlicht2.au3"

_IrrStart( $IRR_EDT_OPENGL, 800, 600, $IRR_BITS_PER_PIXEL_32, _
        $IRR_WINDOWED, $IRR_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON )

local $nodeSphere = _IrrAddSphereSceneNode(4, 32)
_IrrSetNodeMaterialTexture( $nodeSphere, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0)

local $nodeLight = _IrrAddLight($IRR_NO_PARENT, 0,50,0, 0.9,0.9,0.9, 1000.0)
_IrrAddFlyCircleAnimator($nodeLight, 0, 0, 0, 500, 0.001)

local $nodeCamera = _IrrAddCamera(-5,5,-6, 0,0,0 )

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

_IrrStop()