2.3.0 • Published 3 years ago

ore-three-ts v2.3.0

Weekly downloads
51
License
MIT
Repository
github
Last release
3 years ago

Ore Three

three.js utils.

npm.io

Documentation Examples

install

You can get the library from npm.

$ npm install ore-three-ts
Import
import * as ORE from 'ore-three-ts';

Create Controller

import * as ORE from 'ore-three-ts';

import { ControllerScene } from './ControllerScene';

export class APP {

	private controller: ORE.Controller;

	constructor() {

		this.controller = new ORE.Controller();

		this.controller.addLayer( new ControllerScene(), {
			name: 'Main',
			canvas: document.querySelector( '#canvas' ) as HTMLCanvasElement,
		} );

	}

}

window.addEventListener( 'load', () => {

	let app = new APP();

} );

Create Scene

import * as THREE from 'three';
import * as ORE from 'ore-three-ts';

export class ControllerScene extends ORE.BaseLayer {

	private box: THREE.Mesh;

	constructor() {

		super();

	}

	public onBind( info: ORE.LayerInfo ) {

		super.onBind( info );

		this.camera.position.set( 0, 1.5, 4 );
		this.camera.lookAt( 0, 0, 0 );

		this.box = new THREE.Mesh( new THREE.BoxGeometry(), new THREE.MeshNormalMaterial() );
		this.scene.add( this.box );

	}

	public animate( deltaTime: number ) {

		this.box.rotateY( 1.0 * deltaTime );

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

	}

	public onResize() {

		super.onResize();

	}

	public onTouchStart( args: ORE.TouchEventArgs ) {

	}

	public onTouchMove( args: ORE.TouchEventArgs ) {

	}

	public onTouchEnd( args: ORE.TouchEventArgs ) {

	}

	public onHover( args: ORE.TouchEventArgs ) {

	}

	public onWheel( event: WheelEvent, trackpadDelta: number ) {

	}


}
2.3.0

3 years ago

2.3.0-beta1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-dev8

4 years ago

2.0.0-dev7

5 years ago

2.0.0-dev6

5 years ago

2.0.0-dev5

5 years ago

2.0.0-dev4

5 years ago

2.0.0-dev3

5 years ago

2.0.0-dev2

5 years ago

2.0.0-dev1

5 years ago

1.0.5

5 years ago

1.0.5-dev2

5 years ago

1.0.5-dev3

5 years ago

1.0.5-dev1

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.3-dev5

5 years ago

1.0.3-dev4

5 years ago

1.0.3-dev3

5 years ago

1.0.3-dev2

5 years ago

1.0.3-dev1

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.2-beta2

5 years ago

1.0.2-beta3

5 years ago

1.0.2-beta

5 years ago

1.0.0

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago