David Catuhe 66cc6b19ec Merge pull request #8329 from bghgary/gltf-progress-fixes 5 년 전
..
assets c3b8eb071c v4.0.0 6 년 전
dist 7c94c92437 Build 6 년 전
src 66cc6b19ec Merge pull request #8329 from bghgary/gltf-progress-fixes 5 년 전
tests 09725b14ef simplify code contributions by fully automating the dev setup with gitpod. 5 년 전
README-ES6.md 19ffc6ba85 update md file 6 년 전
README.md bb272a3545 Viewer configuration - initial 7 년 전
package.json 28c31ea7d0 Fix Audit 5 년 전
tsconfig-gulp.json aec2300401 fixy fixy 6 년 전
tsconfig.json 51d4c34547 started trying to update publishing 6 년 전
webpack.assets.config.js 783c1f0bfd upgrading webpack and adjusting gulp run and build 7 년 전
webpack.config.js d8ef05b775 Es6 Packages 6 년 전
webpack.gulp.config.js b48d79e4c9 Fix viewer visual tests 6 년 전

README-ES6.md

BabylonJS Viewer

This project is a 3d model viewer using babylonjs. Online docs: https://doc.babylonjs.com/extensions/the_babylon_viewer

ES6/NPM usage

Install the package using npm:

npm install @babylonjs/viewer --save

Then in JS/Typescript the viewer to be imported via:

import * as BabylonViewer from '@babylonjs/viewer';

Add a babylon element in an html file:

<babylon id="babylon-viewer" camera.behaviors.auto-rotate="0"></babylon>

And used to load models

BabylonViewer.viewerManager.getViewerPromiseById('babylon-viewer').then(function (viewer) {
    // this will resolve only after the viewer with this specific ID is initialized
    viewer.onEngineInitObservable.add(function (scene) {
        viewer.loadModel({
            title: "Helmet",
            subtitle: "BabylonJS",
            thumbnail: "https://www.babylonjs.com/img/favicon/apple-icon-144x144.png",
            url: "https://www.babylonjs.com/Assets/DamagedHelmet/glTF/DamagedHelmet.gltf"
        });
    });
});