Camera models and controllers.
var createPerspectiveCamera = require('pex-cam/perspective')
Creates new perspective camera
opts:
object with one or more of the following optionsposition
: vec3 - camera position,[0, 0, 3]
target
: vec3 - camera target,[0, 0, 0]
up
: vec3 - camera up direction,[0, 1, 0]
fov
: Number - vertical field of view,PI/3 (60 deg)
aspect
: Number - aspect ratio ,1
near
: Number - near clipping plane,0.1
far
: Number - far clipping plane,100
opts
: seecreatePerspectiveCamera
Create picking ray in view (camera) cooridinates
x
: Number - mouse xy
: Number - mouse ywindowWidth
: NumberwindowHeight
: Number
Create picking ray in world coordinates
x
: Number - mouse xy
: Number - mouse ywindowWidth
: NumberwindowHeight
: Number
Orbiter controller
var createOrbiter = require('pex-cam/orbiter')
Creates new orbiter controller
opts
: object with one or more of the following optionscamera
: PerspectiveCamera - camera to be controlledelement
: DOM Element - mouse events target,window
easing
: Number, amount of intertia,0
drag
: Boolean - enable drag rotation,true
zoom
: Boolean - enable mouse wheel zooming,true
pan
: Boolean - enable shift + drag panning,true
lat
: Number - latitude of the orbiter position, defaults to camera.positionlon
: Number - longitude of the orbiter position, defaults to camera.position
opts
: seecreateOrbiter
MIT, see LICENSE.md for details.