# scene-template

> a quick template for threejs scene

Latest version **1.0.9** (published 2016-11-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install scene-template
pnpm add scene-template
yarn add scene-template
bun add scene-template
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2016-11-04 |
| First published | 2016-08-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nascherman |
| Maintainers | nascherman |
| Keywords | template, demo, webgl, threejs |

## Links

- npm: https://www.npmjs.com/package/scene-template
- npm.io page: https://npm.io/package/scene-template

## Dependencies (4)

- [object-assign](https://npm.io/package/object-assign.md) ^4.1.0
- [orbit-controls](https://npm.io/package/orbit-controls.md) ^1.1.1
- [three-fly-controls](https://npm.io/package/three-fly-controls.md) ^1.1.0
- [three-first-person-controls](https://npm.io/package/three-first-person-controls.md) ^0.2.1

## Recent versions

- 1.0.9 (latest) — 2016-11-04
- 1.0.7 — 2016-09-10
- 1.0.6 — 2016-09-08
- 1.0.5 — 2016-09-08
- 1.0.4 — 2016-08-09
- 1.0.3 — 2016-08-09
- 1.0.2 — 2016-08-08
- 1.0.1 — 2016-08-05
- 1.0.0 — 2016-08-05

## README

# scene-template

A threejs scene template based on work by [@mattdesl](https://twitter.com/mattdesl). Used to quickly generate a scene for demos or other. 

## Usage

```javascript
var createApp = require('scene-template');
```

   can be `orbit`, `first-person`, or `fly` controls. with the corresponding options

Pass in options for the renderer, controls and any initial objects.

```javascript
opts = {
  // pass in options to the webgl renderer
  renderer: {
    antialias: true
  },
  width: 500, // dimensions of the renderer, defaults to window size
  height: 500,
  // controls. Can be 'fly' or 'first-person' controls as well 
  controls: {
    type: 'orbit', 
    theta: 50 * Math.PI / 180,
    phi: -50 * Math.PI / 180,
    distance: 60
  },
  domElement: document.body,
  // add any initial objects to the scene
  objects: [
    mesh1,
    light
  ]
}
```

You can retrieve a reference to the scene objects from the create method
```javascript
const {
  renderer,
  camera,
  scene,
  updateControls
} = createApp(opts, THREE);
```

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