pointShadowLight()
Purpose
Creates a pinpoint light source in 3D space that casts a shadow
Description
Creates a pinpoint light source in the specified position of the specified colour and brightness that casts a shadow
Syntax
handle = pointShadowLight( 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
resolution resolution of shadows (higher is smoother)
Example
setCamera( { 0, 4, 10 }, { 0, 0, 0 } )
obj = [
placeObject( cube, { 0, 0, 0 }, { 4, 0.1, 4 } )
placeObject( cube, { 0, 2, 0 }, { 1, 1, 1 } )
]
setObjectMaterial( obj[0], bisque, 0, 1 )
setObjectMaterial( obj[1], cyan, 0, 1 )
lightpos = { 0, 6, 2 }
light = pointShadowLight( lightpos, white, 50, 1024 )
loop
clear()
c = controls( 0 )
lightpos += { c.lx, c.ry, -c.ly } * 0.1
setLightPos( light, lightpos )
rotateObject( obj[1], { 0, 1, 0 }, 1 )
drawObjects()
printAt( 0, 0, "Use Joy-Con Control Sticks to adjust light position" )
printAt( 0, 2, "
Associated Commands
pointLight(), removeLight(), setAmbientLight(), setLightBrightness(), setLightColour(), setLightDir(), setLightPos(), setLightSpread(), spotLight(), worldLight(), worldShadowLight()