Clouds

Blitz3D Forums/Blitz3D Programming/Clouds

Blitz progrtammer,

two very easy way to make sky and clouds as follows:

Sky:

Graphics3D 1024,768,32
SetBuffer BackBuffer()



; create a camera to view our sky with, leave it at its default position for now
camera = CreateCamera()
CameraRange camera,1,20000

; first create a plane which will be an infinite flat plane for your whole sky
Global sky = CreatePlane()

AmbientLight 255,255,255
; now load a nice looking sky texture - available from many places on web
Global skytexture = LoadTexture("CLOUD2.JPG") ; "the_name_of_your_sky_texture.bmp",3)

; now texture the sky plane entity with this texture so it looks like a lareg sky
; but remember the texture needs to be scaled to look right and
; unless you are above the sky plane - the texture will be facing up so
; from a camera below you will not see it unless you rotate it 180 degrees
EntityTexture sky,skytexture
ScaleTexture skytexture,10000,10000
PositionEntity sky,0,200,0


RotateEntity sky,180,0,0
;now make the sky a little see through
;EntityAlpha sky,0.5

; set a variable so you can rotate the texture to get some movement up there
; - the # makes it floating point
Global xrotate# = 0



While Not KeyDown(1)

xrotate=xrotate+0.02
RotateTexture skytexture,xrotate

UpdateWorld
RenderWorld


Flip

Wend
End

**************

You need to make the sky texture something which will be seamless where the texture repeats, use a photoshop filter such as offset to create this.


Next you could add some scudding sprites or a second level using another moving plane, move it more slowly and make the first plane see through by adjusting the entityalpha line.

Hope this is of some use.

IPete2.