Not the best of code – but incase anyone else wants it….
;set up fps counter
fps_milli=MilliSecs(): fps_counter=0: update_frequency=10
Graphics3D 800,600,32
SetBuffer BackBuffer()
light=CreateLight()
LightColor light,50,50,170
AmbientLight 51,51,51
piv=CreatePivot()
cam=CreateCamera()
PositionEntity cam,0,0,-50
final=LoadMesh(andquot;2.xandquot;)
SeedRnd MilliSecs()
Type ship
Field X
Field Y
Field model
Field xturn
Field yturn
Field zturn
End Type
For tempx = 0 To 99
andnbsp; andnbsp; andnbsp;alien.ship = New ship
andnbsp; andnbsp; andnbsp;alienx = 25-Rnd(50)
andnbsp; andnbsp; andnbsp;alieny =25-Rnd(50)
andnbsp; andnbsp; andnbsp;alienxturn=Rnd(10)/5-1
andnbsp; andnbsp; andnbsp;alienyturn=Rnd(10)/5-1
andnbsp; andnbsp; andnbsp;alienzturn=Rnd(10)/5-1
andnbsp; andnbsp; andnbsp;alienmodel=CopyMesh(final)
Next
For alien.ship = Each ship
andnbsp; andnbsp; andnbsp;PositionEntity alienmodel,alienx,alieny,0
Next
While Not KeyDown(1)
For alien.ship = Each ship
andnbsp; andnbsp; andnbsp;TurnEntity alienmodel,alienxturn,alienyturn,alienzturn
Next
andnbsp; andnbsp; andnbsp;UpdateWorld
andnbsp; andnbsp; andnbsp;RenderWorld
; fps counter*********************
andnbsp; andnbsp; andnbsp;fps_counter=fps_counter+1
andnbsp; andnbsp; andnbsp;If fps_counter=update_frequency
andnbsp; andnbsp; fps=1000/Float(((MilliSecs()-fps_milli))/update_frequency)
andnbsp; andnbsp; fps_milli=MilliSecs()
andnbsp; andnbsp; fps_counter=0
andnbsp; andnbsp; EndIf
; print fps**************
Text 0,0,andquot;FPS:andquot;+fps
andnbsp; andnbsp; andnbsp;Flip
Wend
EndGraphics
End