;SpacesphereGraphics3D 640,480,0,2camera=CreateCamera()light=CreateLight()RotateEntity light,45,45,0;Create the Texturewidth=1024sptex = CreateTexture(width,width,1+8)SetBuffer TextureBuffer(sptex)For a = 1 To 200 Plot Rand(0,width-1),Rand(0,width-1)NextSetBuffer BackBuffer()TextureBlend sptex,5;Create the Spherespbox = CreateSphere(5)ScaleEntity spbox,1000,1000,1000EntityTexture spbox,sptexScaleTexture sptex,.25,.5EntityFX spbox,1FlipMesh spboxEntityOrder spbox,99999ball=CreateSphere(5)While Not KeyHit(1) RenderWorld sincos#=sincos#+0.2 PositionEntity ball,50*Sin(sincos#),25*Cos(sincos#),200*Cos(sincos#) If KeyDown(200) Then TurnEntity camera,-0.25,0,0 ;up key If KeyDown(208) Then TurnEntity camera,0.25,0,0 ;down key If KeyDown(203) Then TurnEntity camera,0,0.25,0 ;left key If KeyDown(205) Then TurnEntity camera,0,-0.25,0 ;right key If KeyHit(17) Then wf=Not wf : WireFrame wf ;W key Text 0,0,"Arrow keys=move camera, W=wireframe" FlipWend
;SpacesphereGraphics3D 640,480,0,2camera=CreateCamera()light=CreateLight()RotateEntity light,45,45,0;Create the Texturewidth=1024sptex = CreateTexture(width,width,1+8)SetBuffer TextureBuffer(sptex)For a = 1 To 200 Plot Rand(0,width-1),Rand(0,width-1)NextSetBuffer BackBuffer()TextureBlend sptex,5;Create the Spherespbox = CreateSphere(5)ScaleEntity spbox,1000,1000,1000EntityTexture spbox,sptexScaleTexture sptex,.25,.5EntityFX spbox,1FlipMesh spboxEntityOrder spbox,99999;Create the Sphere2spbox2 = CreateSphere(5)ScaleEntity spbox2,900,900,900EntityTexture spbox2,sptexScaleTexture sptex,.35,.5EntityAlpha spbox2,.5FlipMesh spbox2EntityOrder spbox2,999ball=CreateSphere(5)While Not KeyHit(1) sincos#=sincos#+0.2 PositionEntity ball,50*Sin(sincos#),25*Cos(sincos#),200*Cos(sincos#) If KeyDown(200) Then TurnEntity camera,-0.35,0,0 ;up key TurnEntity spbox2,-0.30,0,0 ;up key EndIf If KeyDown(208) Then TurnEntity camera,0.35,0,0 ;down key TurnEntity spbox2,0.30,0,0 ;down key EndIf If KeyDown(203) Then TurnEntity camera,0,0,35,0 ;left key TurnEntity spbox2,0,0,30,0 ;left key EndIf If KeyDown(205) Then TurnEntity camera,0,-0.35,0 ;right key TurnEntity spbox2,0,-0.30,0 ;right key EndIf If KeyHit(17) Then wf=Not wf : WireFrame wf ;W keyRenderWorld Text 0,0,"Arrow keys=move camera, W=wireframe" FlipWend