Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A sphere that bounces up and down over time.
# babylonjs/demo/bouncing_sphere.js
const canvas = document.getElementById('renderCanvas');
const engine = new BABYLON.Engine(canvas, true);
const scene = new BABYLON.Scene(engine);
const camera = new BABYLON.ArcRotateCamera('camera', Math.PI/2, Math.PI/4, 10, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, true);
const light = new BABYLON.HemisphericLight('light', new BABYLON.Vector3(1, 1, 0), scene);
const sphere = BABYLON.MeshBuilder.CreateSphere('sphere', {diameter: 1}, scene);
scene.registerBeforeRender(() => { sphere.position.y = Math.abs(Math.sin(Date.now() * 0.002)) * 2; });
engine.runRenderLoop(() => { scene.render(); });Babylon.js is a powerful, open-source 3D engine for the web that enables developers to build immersive 3D games, simulations, visualizations, and XR experiences directly in the browser using WebGL, WebGPU, or WebXR.
Origin & Creator
Babylon.js was created by David Catuhe and the Microsoft Babylon team in 2013, with contributions from a large open-source community.
Industrial Note
Babylon.js is frequently used in aerospace simulations, product configurators, architectural walkthroughs, XR training, and high-fidelity 3D commerce applications.