Babylon.sbi is a module coded with theSpiderBasic language that provides simplified access to the framework javascript 3D babylonjs.com created by David Catuhe and David Rousset, two web engineers at Microsoft.
■ Sources and examples on the GitHub platform.
https://github.com/falsam/BJS
■ Structure of your folder.
→ Babylon A folder containing the interfaces with the Babylon.js framework (do not change the name).
→ sbbjs Folder containing the babylon.custom.js framework that will be exported when creating your application
→ Data Optional folder that will contain your textures, sound, etc ....
Code.sb Your code. (See examples 00-template.sb)
■ Example
Code: Select all
;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, #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)
MoveMesh(Cube, -3, 1, -2)
Torus = CreateTorus("torus", 2, 1)
MoveMesh(Torus, -2, 0.5, 2)
RenderLoop(@RenderGame())
EndIf
EndProcedure
Procedure RenderGame()
RenderWorld()
EndProcedure
■ ShowCase
Water http://falsam.com/sbbjs/water.html (Use the mouse to explore the scene)
Music http://falsam.com/sbbjs/music.html
particle http://falsam.com/sbbjs/particle.html
■ In french : http://falsam.com/sbbjs/wiki/doku.php?id=babylon