; CreatePivot Example ; ------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,2,-10 light=CreateLight() RotateEntity light,45,45,0 ; Create a pivot - an invisible entity with just a position and orientation pivot=CreatePivot() ; Parent a planet to the pivot, offset 4 units from it planet=CreateSphere(16,pivot) ScaleEntity planet,0.5,0.5,0.5 PositionEntity planet,4,0,0 EntityColor planet,0,150,255 While Not KeyDown(1) ; Turning the invisible pivot swings the planet around it TurnEntity pivot,0,1,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Arrow keys: move camera Esc: exit" Text 0,20,"The planet orbits the invisible pivot created by CreatePivot()" Flip Wend End