I am new to B3D and this 3D API business, but otherwise I am an experienced programmer. This has got me stumped however. I am just starting out on a 3D Orrery program - I want to be able to fly around the Solar System using proper newtonian Physics (like Elite Frontier). Can anyone explain what is going wrong at frame 426 onwards? (code below...)
Thanks
Const x_res = 800
Const y_res = 600
frame_number = 0
Graphics3D x_res, y_res
SetBuffer BackBuffer()
AmbientLight 0, 0, 0
WireFrame True
AntiAlias True
camera=CreateCamera()
CameraViewport camera, 0, 0, x_res, y_res
light=CreateLight(1)
LightColor light, 255, 255, 255
PositionEntity light, 10, 0, 19
planet=CreateSphere(16)
ScaleEntity planet, 20, 20, 20
PositionEntity planet, 0, 0, 23
TurnEntity planet, -40, 0.0, 0.0
PointEntity light, planet
While Not KeyHit(1)
oldTime=MilliSecs()
While MilliSecs() < oldTime + 100 : Wend
TurnEntity planet, 0.0, 0.1, 0.0
MoveEntity camera, 0, 0.1, -0.02
PointEntity camera, planet
UpdateWorld
RenderWorld
frame_number = frame_number + 1
Text 100, 100, "Frame " + frame_number
Text 100, 120, "Cam Y " + EntityY#(camera)
Flip
Wend
End
Thanks
Const x_res = 800
Const y_res = 600
frame_number = 0
Graphics3D x_res, y_res
SetBuffer BackBuffer()
AmbientLight 0, 0, 0
WireFrame True
AntiAlias True
camera=CreateCamera()
CameraViewport camera, 0, 0, x_res, y_res
light=CreateLight(1)
LightColor light, 255, 255, 255
PositionEntity light, 10, 0, 19
planet=CreateSphere(16)
ScaleEntity planet, 20, 20, 20
PositionEntity planet, 0, 0, 23
TurnEntity planet, -40, 0.0, 0.0
PointEntity light, planet
While Not KeyHit(1)
oldTime=MilliSecs()
While MilliSecs() < oldTime + 100 : Wend
TurnEntity planet, 0.0, 0.1, 0.0
MoveEntity camera, 0, 0.1, -0.02
PointEntity camera, planet
UpdateWorld
RenderWorld
frame_number = frame_number + 1
Text 100, 100, "Frame " + frame_number
Text 100, 120, "Cam Y " + EntityY#(camera)
Flip
Wend
End