Outils pour utilisateurs

Outils du site


playground:water

09-Water.sb

Voir

09-water.sb
;Babylon.sbi - Water
 
EnableExplicit
 
IncludeFile "babylon/babylon.sbi"
 
Global Camera, Light, Sky, Ground, GroundTex, GroundMat, Water
 
Declare LoadGame()
Declare RenderGame()
 
UseModule BJS
 
InitEngine(@LoadGame())
 
Procedure LoadGame()  
  If CreateScene()
 
    ;Camera & Light
    Camera = CreateCamera("camera", 0, 20, 80, #BJS_Free)
    CameraBodySize(Camera, 1, 10, 1)
 
    Light = CreateLight("Light", 0, 100, 100, 0.8, #BJS_Hemispheric)
 
    ;SkyBox
    Sky = SkyBox("Santa", "data/textures/sky/cloud", 1000)
 
    ;Ground
    Ground = CreateGround("grass", 1000, 1000)
    GroundTex = LoadTexture("grass", "data/textures/grass.jpg")
    GroundMat = CreateMaterial("grass")
    SetMaterialTexture(GroundMat, #BJS_Diffuse, GroundTex)
    ScaleMaterial(GroundMat, 64, 64)
    SetMeshMaterial(Ground, GroundMat)
    MoveMesh(Ground, 0, -2, 0)
 
    ;Water
    Water = CreateWater("water", "data/textures/waterbump.png", 1000, 1000, 64)
 
    WaterRenderList(Water, Ground)
    WaterRenderList(Water, Sky)
 
    RenderLoop(@RenderGame())
  EndIf
EndProcedure
 
Procedure RenderGame()   
  RenderWorld() 
EndProcedure
playground/water.txt · Dernière modification: 2018/01/11 01:57 de falsam