Edit!!! Reject this - I should have used the command "point light" not "set directional light".
Original post follows:
Title should speak for itself, but here's a simple demo anyway.
Just press r to change the light direction. You'll see the red light is reset to the white default. This is unhelpful surely?
set display mode desktop width(), desktop height(), 32
sync on: sync rate 60: sync
autocam off
position camera 0, 50, -300
point camera 0, 0, 0
make object sphere 1, 50
position object 1, 0, 0, 0
global cx#
global cy#
cx# = camera angle x()
cy# = camera angle y()
color light 0, 255, 0, 0
keyPressed = 0
repeat
set cursor 0, 20
if inkey$() = "r"
keyPressed = 1
set directional light 0, 0, -1, 0
else
if keyPressed then set directional light 0, 0, 1, 0
endif
positionCamera()
sync
until spacekey()
end
function positionCamera()
control camera using arrowkeys 0, 1, 0
cx# = cx# + mousemovey()*0.25: cy# = cy# + mousemovex()*0.25
rotate camera cx#, cy#, 0
endfunction