@jsantell/three-app

1.0.0 • Public • Published

three-app

Build Status

Personal generalized app structure for THREE apps. Hosted on npm as @jsantell/three-app. ES6-ified for inclusion via module bundler.

Best explanation is probably just to read the source.

Installation

$ npm install --save @jsantell/three-app

Usage

import { Mesh, BoxBufferGeometry, MeshBasicMaterial } from 'three';
import ThreeApp from '@jsantell/three-app';

class App extends ThreeApp {
  init() {
    this.box = new Mesh(new BoxBufferGeometry(), new MeshBasicMaterial({color:0xff0000}));
    this.scene.add(this.box);
    this.camera.position.z = 3;
  }

  update(t, delta) {
    this.box.rotation.z += delta * 0.001;
    this.box.rotation.y += delta * 0.001;
  }

  render() {
    this.renderer.render(this.scene, this.camera);
  }
}

window.app = new App();

Build

$ npm run build

Publish

$ npm run version

License

MIT License, Copyright © 2018 Jordan Santell

Readme

Keywords

Package Sidebar

Install

npm i @jsantell/three-app

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

7.29 kB

Total Files

7

Last publish

Collaborators

  • jsantell