Skies

Blitz3D Forums/Blitz3D Beginners Area/Skies

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You don't really need to make the sphere larger than your world. You can just change it's Z order so it gets rendered before anything else, then it will appear behind everything. Move it with the camera so you'll always be inside.

Graphics3d 800,600

world = LoadMesh("level.b3d") ;load your world
sky = LoadTexture("Sky.png") ;load the sky texture
skybox = CreateSphere() ;create your sphere for the sky
FlipMesh skybox ;flip the surfaces to the inside
EntityOrder skybox,1 ;change the entity Z order so it will be drawn first.
EntityTexture skybox,sky

camera = CreateCamera()

While Not KeyDown(1)

UpdateCameraPosition() ;Some function used to read input and update the camera view accordingly
PositionEntity skybox, EntityX(camera),EntityY(camera),EntityZ(camera) ;move the skybox to the camera's position

RenderWorld
Flip
Wend