gl-viewport
toggle between orthographic and perspective projection camera views
example
var shell = ;var vport = shell viewMode: 'ortho' ;window;var mesh;shell;shell;
Run this demo on requirebin.
methods
var viewport =
var vport = viewport(shell, opts)
Create a viewport instance vport
from a
game-shell shell
.
Set the view mode with opts.viewMode
. Either 'perspective'
or 'ortho'
.
Default: 'ortho'
.
You can also set the initial opts.view
and opts.projection
matricies.
vport.setViewMode(mode)
Change the view mode
: 'ortho'
and 'perspective'
are supported.
vport.draw(mesh)
Draw mesh
with the viewport projection and view matrix.
install
With npm do:
npm install gl-viewport
license
MIT