Outils pour utilisateurs

Outils du site


playground:basicscene

01-BasicScene.sb

Demo

01-BasicScene.sb
;Babylon.sbi - Basic Scene
 
EnableExplicit
 
IncludeFile "babylon/babylon.sbi"
 
Global Camera, Light, Plane, Sphere, Cylinder, Cube, Torus
 
Declare LoadGame()
Declare RenderGame()
 
UseModule BJS 
 
InitEngine(@LoadGame())
 
Procedure LoadGame()    
  If CreateScene()
    ;Camera & Light
    Camera  = CreateCamera("camera", 0, 5, 7, #BJS_ArcRotate)
    Light   = CreateLight("light", 0, 10, 0)
 
    ;Objects (Plane, Sphere, ....)
    Plane   = CreateGround("plane", 10, 10)
    Sphere  = CreateSphere("sphere", 2)
    MoveMesh(Sphere, 0, 2, 0)
 
    Cylinder= CreateCylinder("cylinder", 2, 2, 2)
    MoveMesh(Cylinder, 3, 1, -2)
 
    Cube = CreateBox("cube", 2 , 2, 4)
    MoveMesh(Cube, -3, 1, -2)
 
    Torus = CreateTorus("torus", 2, 1)
    MoveMesh(Torus, -2, 0.5, 2)
 
    RenderLoop(@RenderGame())
  EndIf
EndProcedure
 
Procedure RenderGame()  
  RenderWorld()  
EndProcedure
playground/basicscene.txt · Dernière modification: 2018/01/08 21:02 par falsam