-
-
Notifications
You must be signed in to change notification settings - Fork 109
tr Babylon
pmgl edited this page Nov 15, 2022
·
1 revision
Babylon.js is an open-source 3D rendering engine based on WebGL.
Website: https://www.babylonjs.com/
Github: https://github.com/BabylonJS/Babylon.js
After creating your project, open the settings tab, click "Show advanced settings" and choose Babylon.js as "Graphics library".
Creating a new scene:
scene = new BABYLON.Scene()
Adding a simple box:
box = BABYLON.MeshBuilder.CreateBox("box", object end, scene)
box.position.set(0,20,0)
Adding an hemispherical light:
light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene)
Setting up the camera:
camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 0, -100), scene)
In your function draw()
, simply call screen.render
, passing your scene as argument:
draw = function()
screen.render(scene)
end