Blender to BJS, using glTF

Blender to BJS, using glTF

glTF exporter will allow you to export your scene using PBR workflow.


Since Blender 2.8, glTF addon comes with Blender enabled by default. You can update it from the official Github repo. Official documentation is on Blender Manual.

It should be compatible with Blender 2.79b, but you may also note that the old exporter is still available (old documentation).

Axys conventions aren't the same between Blender,Babylon.js (left handed) & glTF (right handed), so you can see below a conversion table to help you about coordinates.

To help transforming, note that theBabylon.js loader will automatically set glTF assets as children of an object:

  • named __root__
  • rotated by default to 180° on Y axys
  • scaled on Z by -1
Blender asset positionBabylon.js asset absolutePosition
Blender asset position
Babylon.js asset absolutePosition
Blender asset position
Babylon.js asset absolutePosition
Blender asset position
Babylon.js asset absolutePosition

Try it out

Once your scene is exported, you have multiple solutions to test it:


Let's say you have exported WaterBottle.glb:

  • export to .gltf or .glb in a folder
  • create a file named index.html, and copy the code above:
<!DOCTYPE html>
<title>Default .gltf loading scene</title>
<meta charset="UTF-8" />
<!-- this link to the preview online version of BJS -->
<script src=""></script>
<!-- this is needed for BJS to load scene files -->
<script src=""></script>
body {
overflow: hidden;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
#canvas {
width: 100%;
height: 100%;
touch-action: none;
<canvas id="canvas"></canvas>
<script type="text/javascript">
const canvas = document.getElementById("canvas");
const engine = new BABYLON.Engine(canvas, true);
// here the doc for Load function: //
BABYLON.SceneLoader.Load("", "WaterBottle.glb", engine, function (scene) {
scene.createDefaultCamera(true, true, true);
createGround: false,
createSkybox: false,
engine.runRenderLoop(function () {
window.addEventListener("resize", function () {
  • double-click on the index.html file

    • some browsers may not want loading the scene, for some security issues (e.g.: Chrome). In this case, you have to open the html file through a webserver (local or not), or try into another browser (e.g.: Firefox, Edge)
  • ... profit!

blender gltf scene loaded in BJS