3D Solar System

Blitz3D Forums/Blitz3D Programming/3D Solar System

It says "Could not load: Mercury.bmp" Here is the new version:
AppTitle "Solar System Sim"

Graphics3D 1280,1024,32,0

SetBuffer BackBuffer()

Global camera = CreateCamera()
PositionEntity camera,0,0,-10
Global light = CreateLight()

Global Sun = CreateSphere()
Global Mercury = CreateSphere(10,Sun)

Global Yellow = CreateBrush(255,255,0)

DoLoadBrush(Mercury,"Mercury.bmp")

PositionEntity Sun,0,0,0
PaintMesh Sun,Yellow
FreeBrush Yellow

While Not KeyHit(1)

RotateMesh Sun,0,5,0

UpdateWorld
RenderWorld
Flip

Wend

End

Function DoLoadBrush(mesh,what$)

If FileType(what$) = 0 Then
	brush = LoadBrush(what$)
	If brush = 0 Then
		RuntimeError "Could not load: " + what$
	EndIf
Else
	RuntimeError what$ + " does not exist"
EndIf

PaintMesh mesh,brush
FreeBrush brush

End Function