1.0.5 • Published 4 years ago

webxrscene v1.0.5

Weekly downloads
5
License
ISC
Repository
github
Last release
4 years ago

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();
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago