I'm trying to make a solar eclipse simulation with Blitz3D. Is there anyway I can make the "sun" radiate light?
Thanks.
Thanks.
A clearer depiction
Graphics3D 640,480 SetBuffer BackBuffer() light=CreateLight(1) ;Lights need to have a type set. 1-3 for various types of Light. camera=CreateCamera() PositionEntity camera, 0,0,-7 sun=CreateSphere (16) PositionEntity sun, 0,0,1 ;---------------------------changed 'nucleus' to SUN tex=LoadTexture( "thesun.jpg" ) EntityTexture sun,tex ;glow setup s=1 Global sizex=640/s Global sizey=480/s Global glowtexture=CreateTexture (384,384,256) Global sp=CreateSprite(camera) MoveEntity sp,-.25,-0.06,1.18 EntityAlpha sp,.32 ScaleTexture glowtexture,GraphicsWidth()/sizex,GraphicsHeight()/sizey EntityTexture sp,glowtexture TextureBlend glowtexture, 5 While Not KeyDown(57) ; - I have changed this to the SPACEBAR, otherwise, the second loop thinks you're still pressing ESCAPE! TurnEntity sun,0.5,0.5,0.5 RenderWorld Flip ; Since you are working in the BackBuffer, you need To use Flip To display the Render! CopyRect 0,0,sizex,sizey,0,0,BackBuffer(),TextureBuffer(glowtexture) CameraViewport camera,0,0,GraphicsWidth(),GraphicsHeight() Wend pivot=CreatePivot() PositionEntity pivot,0,0,1 orbit=CreateSphere(16,pivot) tex1=LoadTexture( "orbit.jpg" ) EntityTexture orbit, tex1 ScaleEntity orbit, 0.3,0.3,0.3 PositionEntity orbit,4,0,0 While Not KeyDown (1) TurnEntity pivot,0,3,0 pitch#=pitch#+1 yaw#=yaw#+1 roll#=roll#+0 RotateEntity sun,pitch#,yaw#,roll# RenderWorld Flip Wend End
If Not (Tex1) Runtime Error "Texture Did Not Load Correctly"
Tex1 = LoadTexture("orbit.jpg")
tex1=CreateBrush(255, 0, 0);LoadTexture( "orbit.jpg" ) PaintMesh orbit, tex1