; CaptureWorld Example ; -------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,0,-12 light=CreateLight() RotateEntity light,45,45,0 ; Two identical cones, both placed on the left cone1=CreateCone(16) PositionEntity cone1,-4,0,0 ScaleEntity cone1,1,2,1 EntityColor cone1,255,60,60 cone2=CopyEntity(cone1) ; CaptureWorld stores the CURRENT state (position, rotation, scale, alpha) ; of every entity - here, with both cones together on the left CaptureWorld ; Now change the world: move the second cone to the right and tilt it MoveEntity cone2,8,0,0 TurnEntity cone2,0,0,90 tween#=1.0 While Not KeyDown(1) ; Left/Right choose the tween value passed to RenderWorld If KeyDown(203) And tween>0 Then tween=tween-0.01 If KeyDown(205) And tween<1 Then tween=tween+0.01 ; RenderWorld tween draws each entity interpolated between its captured ; state (tween=0) and its current state (tween=1). Games use this to ; render smooth in-between frames when the game logic updates less ; often than the screen refreshes. RenderWorld tween Text 0,0,"Left/Right: change tween Esc: exit" Text 0,20,"CaptureWorld was taken with both cones on the left" Text 0,40,"RenderWorld "+tween Flip Wend End