Exporter

Note that for Camera, the rotateOrder is expected to be ZYX. Otherwise, this could lead to rotations not properly exported.

Operators

Clara.io offers Babylon.js operators for PolyMesh, Light, and Camera that allows to add Babylon.js specific controls.These operators can be found in the category Exporter, which means that their effects can will only be used for exported .babylon files and don’t change the scene in Clara.io.

Note that for PolyMesh, if the skin operator is used, the Babylon.js operator should be used before the skin operator.

This function is intended to import meshes (with their materials and particle systems) from a scene to another. It takes the following parameters:

object name (if you omit this parameter, all the objects are imported)

scene folder (can be empty to use the same folder as your page)

scene file name

a reference to the target scene

a callback to give you the list of imported meshes, particle systems, and skeletons

Creating a scene for Babylon.js

Let create a sample scene with:

A camera

A spot light

A red-ish point light

A cylinder

A plane for the ground

A checkerboard material applied on the cylinder

The cylinder and the plane have a Babylon.js operator with properties Cast Shadow and Receive Shadow set to true. The spot light has a Babylon.js operator with a shadow map type set to Standard with a size of 1024.

Once exported and loaded with the sample code above, the Babylon.js scene looks like this:

Using the Babylon.js Sandbox

There is a great and easy way to test your scene: the Babylon.js Sandbox. With a single drag’n’drop into a web page, you will be able to test your scene without any more setup.

Adding MIME types to your web server

You will need to authorize .babylon MIME type on your web server (and furthermore you will also need to authorize .babylonmeshdata MIME type if you want to use incremental loading)