pointLight()
Purpose
Creates a pinpoint light source in 3D space
Description
Creates a pinpoint light source in the specified position of the specified colour and brightness
Syntax
handle = pointLight( position, colour, brightness )
Arguments
handle The handle of the light source
position A position vector in 3 dimensional space { x, y, z } where the light source is located
colour colour name or RGB values { red, green, blue, opacity } between 0 and 1
brightness A value to indicate the brightness of the light source
Example
setcamera( {0, 10, 10 }, { 0, 0, 0 } )
bright = 50
light = pointLight( { 5, 5, 5 }, red, bright )
ballModel = loadModel( "Kat Deak/Discoball" )
ball = placeObject( ballmodel, { 0, 0, 0 }, { 10, 10, 10 } )
loop
c = controls( 0 )
if (c.up) then
bright = bright + 1
endIf
if (c.down) then
bright = bright - 1
endIf
bright = clamp( bright, 0, 100 )
setlightbrightness( light, bright )
rotateobject( ball, { 0, 1, 0 }, 1.0 )
drawobjects()
printat( 0, 0, "Use up and down arrows to adjust brightness: ", bright )
update()
repeat
Associated Commands
pointShadowLight(), removeLight(), setAmbientLight(), setLightBrightness(), setLightColour(), setLightDir(), setLightPos(), setLightSpread(), spotLight(), worldLight(), worldShadowLight()