0.0.1 • Published 3 years ago
three-shared-scene v0.0.1
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, {});
0.0.1
3 years ago