; Shadows example (an ArcBasic extension) ; S toggles shadows, Q changes the shadow quality, Escape quits Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,6,-12 TurnEntity camera,25,0,0 AmbientLight 70,70,80 ; the sun: a directional light, pointing down at an angle sun=CreateLight(1) RotateEntity sun,50,30,0 LightShadows sun ground=CreatePlane() EntityColor ground,120,160,120 cube=CreateCube() PositionEntity cube,-2,1,0 EntityColor cube,200,80,80 ball=CreateSphere(16) PositionEntity ball,2,1.5,1 EntityColor ball,80,120,220 ; this cube neither casts nor receives shadows ghost=CreateCube() PositionEntity ghost,0,1,3 EntityColor ghost,240,240,120 EntityShadows ghost,False,False shadows=True quality=2 While Not KeyDown(1) If KeyHit(31) ; S shadows=Not shadows LightShadows sun,shadows EndIf If KeyHit(16) ; Q quality=(quality+1) Mod 4 ShadowQuality quality EndIf TurnEntity cube,0,1,0 RenderWorld Text 0,0,"Shadows: "+shadows+" Quality: "+quality+" (S / Q)" Flip Wend End