0.0.1 • Published 3 years ago

three-shared-scene v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

three-shared-scene

Quick start

npm install three-shared-scene

On the frontend:

import * as THREE from "three";
import {
    SharedScene,
    SharedSceneWrapper
} from "three-shared-scene";

const sharedScene = new SharedScene();

// treat like you would a THREE.Scene object
const scene = new SharedSceneWrapper(sharedScene);

On the backend you can load an existing THREE.js scene from a file using the fs nodejs module:

const scene = new SharedScene();

const sceneJson = JSON.parse(fs.readFileSync('tests/test-scenes/basic.json', 'utf8'));

scene.fromJSON(testScene);

Usage with WebWorkers

import * as THREE from "three";
import {SharedScene} from "three-shared-scene";


const scene = new THREE.Scene();
const sharedScene = new SharedScene(scene, {});