Skip to content

Commit

Permalink
Refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 7, 2024
1 parent 29f327e commit 792e495
Show file tree
Hide file tree
Showing 3 changed files with 254 additions and 245 deletions.
11 changes: 9 additions & 2 deletions packages/gltf/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@
* ````javascript
* import {SDKError} from "@xeokit/core";
* import {Scene} from "@xeokit/scene";
* import {Data} from "@xeokit/data";
* import {WebGLRenderer} from "@xeokit/webglrenderer";
* import {Viewer} from "@xeokit/viewer";
* import {CameraControl} from "@xeokit/cameracontrol";
* import {loadGLTF} from "@xeokit/gltf";
*
* const scene = new Scene();
* const data = new Data();
*
* const renderer = new WebGLRenderer({});
*
Expand All @@ -83,19 +85,25 @@
* id: "myModel"
* });
*
* const dataModel = data.createModel({
* id: "myModel"
* });
*
* fetch("model.glb").then(response => {
*
* response.arrayBuffer().then(fileData => {
*
* loadGLTF({
* fileData,
* sceneModel
* sceneModel,
* dataModel
* }).then(() => {
*
* sceneModel.build();
*
* }).catch(err => {
* sceneModel.destroy();
* dataModel.destroy();
* console.error(`Error loading glTF data: ${err}`);
* });
*
Expand All @@ -111,4 +119,3 @@
* @module @xeokit/gltf
*/
export * from "./loadGLTF";
export * from "./loadGLTFManifest";
Loading

0 comments on commit 792e495

Please sign in to comment.