Skip to content
TypeScript GLSL JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
build
docs
examples
src
types
webpack
.gitignore
LICENSE
README.md
ore-three-ts.code-workspace
package.json
tsconfig.json

README.md

ore-three

three.js utils.

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 { MainScene } from './scenes/MainScene';

class APP {

	constructor() {
		
		this.controller = new ORE.Controller( {

			canvas: document.querySelector( "#canvas" ),
			retina: false,
			alpha: false,

		} );

		this.controller.bindScene( new MainScene() );

	}

}

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

	let app = new APP();

} );

Create Scene

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

export class MainScene extends ORE.BaseScene {

	constructor() {
		
		super();

		this.name = "MainScene";

	}

	onBind( gProps ) {

		super.onBind( gProps );

		this.renderer = this.gProps.renderer;

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

		var boxGeo = new THREE.BoxGeometry( 1, 1, 1 );
		var boXMat = new THREE.MeshNormalMaterial();
		this.box = new THREE.Mesh( boxGeo, boXMat );
		this.scene.add( this.box );

		this.light = new THREE.DirectionalLight();
		this.light.position.y = 10;
		this.scene.add( this.light );		

	}

	animate( deltaTime ) {
		
		this.box.rotateY( 0.01 );
		this.renderer.render( this.scene, this.camera );

	}

	onResize( args ) {

		super.onResize( args );

	}
	
}

Use utility

if you want add GPU fish...

this.fish = new ORE.Fish( this.renderer,1000,10 );
this.scene.add( this.fish );

and update fish

animate( deltaTime ) {
    
    if( this.fish ) {
    
        this.fish.update(  this.time  );
    
    }
    
}
You can’t perform that action at this time.