1.0.9 • Published 8 years ago

scene-template v1.0.9

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

scene-template

A threejs scene template based on work by @mattdesl. Used to quickly generate a scene for demos or other.

Usage

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.

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

const {
  renderer,
  camera,
  scene,
  updateControls
} = createApp(opts, THREE);
1.0.9

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago