# three-shared-scene

> THREE shared scene

Latest version **0.0.1** (published 2021-09-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install three-shared-scene
pnpm add three-shared-scene
yarn add three-shared-scene
bun add three-shared-scene
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-09-20 |
| First published | 2021-09-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Addison van den Hoeven |
| Maintainers | addyvan |

## Links

- npm: https://www.npmjs.com/package/three-shared-scene
- Repository: https://github.com/addyvan/three-shared-scene
- Homepage: https://github.com/addyvan/three-shared-scene#readme
- Issues: https://github.com/addyvan/three-shared-scene/issues
- npm.io page: https://npm.io/package/three-shared-scene

## Dependencies (3)

- [yjs](https://npm.io/package/yjs.md) ^13.5.12
- [three](https://npm.io/package/three.md) ^0.132.2
- [@types/three](https://npm.io/package/@types/three.md) ^0.131.0

## Recent versions

- 0.0.1 (latest) — 2021-09-20

## README

# three-shared-scene

## Quick start

```bash
npm install three-shared-scene
```

On the frontend:
```typescript
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:
```typescript

const scene = new SharedScene();

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

scene.fromJSON(testScene);
```



## Usage with WebWorkers

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


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

---
_Source: https://npm.io/package/three-shared-scene · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
