Skip to content

i3ernie/three-viewport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

three-viewport

DeepScan grade

one line viewport for three.js

make a simple and fast viewport with camera and scene and render-loop for the three.js 3D library

Examples

usage

ES6

import * as THREE from 'three.module.js';
import Viewport from 'viewport.es.js'

const VP = new Viewport().VP.init().start();

//add new scene element
VP.scene.add( new THREE.Mesh( new THREE.BoxGeometry(10,10,10) ) );

see: https://i3ernie.github.io/three-viewport/examples/min.html

import * as THREE from 'three.module.js';
import Viewport from 'viewport.es.js'

let VP = new Viewport();

VP.init();
VP.start();

let box =  new THREE.Mesh( new THREE.BoxGeometry(10,10,10) );

//add new scene element
VP.scene.add( box );

//animation with loop
VP.loop.add( function(){
  box.position.x = box.position.x + .1
});

see: https://i3ernie.github.io/three-viewport/examples/animation.html