The Babylon.js viewer is the simplest way to display 3D content on a web page.
To display a 3D model on you web page:
Add a script reference to the viewer
<babylon> tag and set the model attribute to point to a
We recommend using the glTF format (
.glb) for displaying 3D models on your webpage. Other formats supported by Babylon.js loaders are also supported by the viewer component including
The Babylon.js viewer automatically provides a default viewing experience for 3D models. All aspects of this experience are configurable. See Configuring the viewer for more information on customizing the viewing experience.
The Babylon.js viewer is available on CDN as well as an NPM package. The Babylon.js viewer is a wrapper around the Babylon.js engine and follows the same versioning scheme as the engine. The currently stable version of the Babylon.js viewer will use the current stable version of Babylon.js engine and the preview version of the Babylon.js viewer will use the preview version of Babylon.js engine.
Stable versions of the viewer are available on:
Preview releases of the viewer are available on:
To install the Babylon.js viewer through NPM use
npm install --save babylonjs-viewer
Afterwards it can be imported to the project using:
import * as BabylonViewer from 'babylonjs-viewer'; BabylonViewer.InitTags("my-tag");
This will enable the BabylonViewer namespace.
Using webpack to package your project will use the minified js file.