; Ambient occlusion and glow example (ArcBasic extensions) ; A toggles ambient occlusion, G toggles glow, Escape quits Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,4,-9 TurnEntity camera,20,0,0 CameraClsColor camera,10,10,25 AmbientLight 120,120,130 light=CreateLight() RotateEntity light,60,40,0 LightColor light,140,140,140 ground=CreatePlane() EntityColor ground,180,180,180 For i=0 To 2 box=CreateCube() PositionEntity box,-3+i*3,1,2+(i Mod 2) EntityColor box,200,200,200 Next ; this ball gives off its own light, so it glows lava=CreateSphere(16) PositionEntity lava,-1.5,1,-1 EntityColor lava,255,80,40 EntityGlow lava,2 ball=CreateSphere(16) PositionEntity ball,1.5,1,-1 EntityColor ball,60,160,255 ao=True : glow=True CameraAmbientOcclusion camera,ao CameraGlow camera,glow While Not KeyDown(1) If KeyHit(30) Then ao=Not ao : CameraAmbientOcclusion camera,ao If KeyHit(34) Then glow=Not glow : CameraGlow camera,glow RenderWorld Text 0,0,"A: ambient occlusion G: glow" Flip Wend End