samples/mak/lights
lights.abs
71 lines of ArcBasic. Words in colour that are commands link to their help page. To run it, download ArcBasic, open the file and press F5.
Global info1$="Lights demo"Global info2$="Features directional, point and spot lights"Include "../start.abs"AmbientLight 0,0,0sphere=CreateSphere(32)camera=CreateCamera()PositionEntity camera,0,0,-3;directional lightlight1=CreateLight( 1 )TurnEntity light1,0,-30,0LightColor light1,255,0,0HideEntity light1;point lightlight2=CreateLight( 2 )PositionEntity light2,5,0,-10LightColor light2,0,255,0LightRange light2,15HideEntity light2;spot lightlight3=CreateLight( 3 )PositionEntity light3,0,0,-10LightColor light3,0,0,255LightConeAngles light3,0,10LightRange light3,15HideEntity light3on1=Trueon2=Trueon3=TrueIf on1 Then ShowEntity light1If on2 Then ShowEntity light2If on3 Then ShowEntity light3While Not KeyHit(1) If KeyHit(59) on1=Not on1 If on1 Then ShowEntity light1 Else HideEntity light1 EndIf If KeyHit(60) on2=Not on2 If on2 Then ShowEntity light2 Else HideEntity light2 EndIf If KeyHit(61) on3=Not on3 If on3 Then ShowEntity light3 Else HideEntity light3 EndIf If on3 RotateEntity light3,Sin(MilliSecs()*.07)*5,Sin(MilliSecs()*.05)*5,0; TurnEntity light3,0,1,0 EndIf UpdateWorld RenderWorld Text 0,FontHeight()*0,"(F1) Light1="+on1 Text 0,FontHeight()*1,"(F2) Light2="+on2 Text 0,FontHeight()*2,"(F3) Light3="+on3 FlipWendEnd
