webxrscene

1.0.5 • Public • Published

webxrscene Package

Installation

npm i webxrscene --save

Import into Projekt

import {webXRscene} from 'webxrscene';
import * as THREE from 'three';

Create Instances

const webXRScene = new webXRScene("element");

Loader loadStack

webXRScene.Loader.loadStack({
  progress: (percentage,singleProgress)=>{
    console.log(percentage,singleProgress);
  },
  stack : [{
    url: "URL TO YOUR GLTF MODEL",
    name:"Name of your model"
  }]
}).then((library)=>{
    console.log("library", library);

    Object.keys(library).map((elements, index)=>{
      console.log(library[elements].scene);
    });
  });

Loader load

  webXRScene.Loader.load({
    url : "URL TO YOUR GLTF MODEL",
    progress : (percentage)=>{
      console.log(percentage);
    },
  }).then((gltf)=>{
    console.log(gltf.scene);
  }).catch((err)=>{
    console.log("error: " , err );
  }).finally(()=>{
    console.log("load complete");
  });

Update loop

  
  webXRScene.Update.AddUpdateMethod("common", ()=>{
     renderer.instance.render( scene, camera.instance );
  });

  //start the loop
  webXRScene.Update.start();

  //stop the loop
  webXRScene.Update.stop();

Readme

Keywords

none

Package Sidebar

Install

npm i webxrscene

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

12.7 kB

Total Files

11

Last publish

Collaborators

  • invisible_sascha