{"_id":"orbiter","_rev":"8-e88e51007f9152be9f50df119f53d30f","name":"orbiter","description":"Orbiting quaternion camera","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"orbiter","version":"1.0.0","description":"Orbiting quaternion camera","main":"orbiter.js","directories":{"example":"example"},"dependencies":{"bunny":"^1.0.1","canvas-fit":"^1.2.0","gl-mat4":"^1.1.2","gl-simplicial-complex":"^4.0.0","mouse-change":"^1.1.1","mouse-wheel":"^1.0.2","orbit-camera-controller":"^3.0.0","right-now":"^1.0.0"},"devDependencies":{},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"https://github.com/mikolalysenko/orbiter.git"},"keywords":["orbit","quaternion","arcball","camera"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/orbiter/issues"},"homepage":"https://github.com/mikolalysenko/orbiter","gitHead":"f6c62aecb5c635a87e551f970422cc9e3cffe624","_id":"orbiter@1.0.0","_shasum":"0218f5d3cc6357e6d4ee4ec663f3dadce78da865","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.26","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"dist":{"shasum":"0218f5d3cc6357e6d4ee4ec663f3dadce78da865","tarball":"https://registry.npmjs.org/orbiter/-/orbiter-1.0.0.tgz","integrity":"sha512-lsG0qhLa8a1N+XBonrf/C/Hcy4yMrCCOvuj1M0Q9SFi/qqWNRPTXjEseMF8avMDqYmdwBqRsNIIdoI99gGRQDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFNi+7Y/NjM4kwKVUaTclzS40uPDlfPQLKG7A5lu7kb2AiEA4SSoayXhGLNaWaSpmddovukzVQXg6zIIYeExl+Z4y/4="}]}},"1.0.1":{"name":"orbiter","version":"1.0.1","description":"Orbiting quaternion camera","main":"orbiter.js","directories":{"example":"example"},"dependencies":{"gl-mat4":"^1.1.2","mouse-change":"^1.1.1","mouse-wheel":"^1.0.2","orbit-camera-controller":"^3.0.0"},"devDependencies":{"bunny":"^1.0.1","canvas-fit":"^1.2.0","gl-simplicial-complex":"^4.0.0","right-now":"^1.0.0"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"https://github.com/mikolalysenko/orbiter.git"},"keywords":["orbit","quaternion","arcball","camera"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/orbiter/issues"},"homepage":"https://github.com/mikolalysenko/orbiter","gitHead":"ff03ca4ad89702903bc1426e3a4b38c89146db43","_id":"orbiter@1.0.1","_shasum":"f2af3ba70f17978f34947be2507e8da1d7bbf788","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.26","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"dist":{"shasum":"f2af3ba70f17978f34947be2507e8da1d7bbf788","tarball":"https://registry.npmjs.org/orbiter/-/orbiter-1.0.1.tgz","integrity":"sha512-RKVdH6MRsvfhElpRshwobF0k99ciGR80e5CXHTN0qe9KI0qbhHm7IPj6Y2+DCsmnPy0knODWOaCPKRi0/CM04g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIySmyvCJyZCkV5i2cL7rvFKFQ5GWUXXOu1si43yGysgIgcUW/7K5j3NzBbYrYTraRhU0IoBYOKjn/d4mqp8Ex6ac="}]}},"1.0.2":{"name":"orbiter","version":"1.0.2","description":"Orbiting quaternion camera","main":"orbiter.js","directories":{"example":"example"},"dependencies":{"gl-mat4":"^1.1.2","mouse-change":"^1.1.1","mouse-wheel":"^1.0.2","orbit-camera-controller":"^3.0.0","right-now":"^1.0.0"},"devDependencies":{"bunny":"^1.0.1","canvas-fit":"^1.2.0","gl-simplicial-complex":"^4.0.0"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"https://github.com/mikolalysenko/orbiter.git"},"keywords":["orbit","quaternion","arcball","camera"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/orbiter/issues"},"homepage":"https://github.com/mikolalysenko/orbiter","gitHead":"0160f6041a6424b4ca651da3b367f46ddc694628","_id":"orbiter@1.0.2","_shasum":"5d38df8324b350035b20a931adc177314ffcd438","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.26","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"dist":{"shasum":"5d38df8324b350035b20a931adc177314ffcd438","tarball":"https://registry.npmjs.org/orbiter/-/orbiter-1.0.2.tgz","integrity":"sha512-0v+Md8ijC6Pk9mnx0kIWSUPGje5s/HmFZtM01sHsCuT62fXWn9/7NJnixv/eRj2DHQcAZyoipUOLptvPIl/z4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDd+Sf0RZLRmtv4F1IQtYKA9qVrYLoy3wtd8FrzF5Ot3gIgb9TjiCr6imb8F3znomLVk9acjAWeE+KNlDUBNtJg91E="}]}}},"readme":"orbiter\n=======\nAn orbiting camera with mouse input bindings.  This is similar to 3d-view-controls, except it doesn't do mode switching and fancy property syntactic sugar, making it much lighter weight.\n\nDefault controls:\n\nButton | Interaction\n-------|------------\nLeft mouse | Rotate\nShift + left mouse *or* scroll horizontally | Roll\nRight mouse | Pan\nMiddle mouse *or* scroll vertically | Zoom\n\n\n# Example\n\n```javascript\nvar createCamera = require('../orbiter')\nvar bunny = require('bunny')\nvar perspective = require('gl-mat4/perspective')\nvar createMesh = require('gl-simplicial-complex')\n\nvar canvas = document.createElement('canvas')\ndocument.body.appendChild(canvas)\nwindow.addEventListener('resize', require('canvas-fit')(canvas))\n\nvar gl = canvas.getContext('webgl')\n\nvar camera = createCamera(canvas, {\n  eye:    [50,0,0],\n  center: [0,0,0],\n  zoomMax: 500\n})\n\nvar mesh = createMesh(gl, {\n  cells:      bunny.cells,\n  positions:  bunny.positions,\n  colormap:   'jet'\n})\n\nfunction render() {\n  requestAnimationFrame(render)\n  if(camera.tick()) {\n    gl.viewport(0, 0, canvas.width, canvas.height)\n    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)\n    gl.enable(gl.DEPTH_TEST)\n    mesh.draw({\n      projection: perspective([], Math.PI/4, canvas.width/canvas.height, 0.01, 1000),\n      view: camera.matrix\n    })\n  }\n}\nrender()\n```\n\n# Interface\n\n## Constructor\n\n#### `var camera = require('orbiter')(element[, options])`\nCreates a new camera object.\n\n* `element` is a DOM node onto which the orbiter is attached\n* `options` is an object with the following optional properties:\n    + `eye` - the position of the camera in world coordinates (Default `[0,0,10]`)\n    + `center` - the target of the camera in world coordinates (Default `[0,0,0]`)\n    + `up` - the up vector of the camera (Default `[0,1,0]`)\n    + `inputEnabled` if set to false, then disables input (Default `true`)\n    + `delay` - amount to delay interactions by for interpolation in ms (Default `16`)\n    + `rotateSpeed` - rotation scaling factor (Default `1`)\n    + `zoomSpeed` - zoom scaling factor (Default `1`)\n    + `translateSpeed` - translation/panning scale factor (Default `1`)\n    + `flipX` - flip X axis for rotations (Default `false`)\n    + `flipY` - flip Y axis for rotations (Default `false`)\n    + `zoomMin` - minimum zoom distance (Default `0.01`)\n    + `zoomMax` - maximum zoom distance (Default `Infinity`)\n\n## Geometric properties\n\n#### `camera.matrix`\nA 4x4 matrix encoded as a length 16 array representing the homogeneous transformation from world coordinates to view (camera) coordinates.\n\n#### `camera.eye`\nThe position of the camera in world coordinates\n\n#### `camera.up`\nA vector pointing up in world coordinates\n\n#### `camera.center`\nThe target of the camera in world coordinates\n\n#### `camera.distance`\nEuclidean distance from `eye` to `center`\n\n## Methods\n\n#### `camera.tick()`\nUpdates the camera state.  Call this before each frame is rendered to compute the current state of the camera.\n\n**Returns** `true` if the state of the camera has changed since the last call to `tick`\n\n#### `camera.lookAt(center, eye, up)`\nSets the camera center/eye/up vector to look at a fixed target\n\n* `center` is the new center/target for the camera\n* `eye` is the position of the camera in world coordinates\n* `up` is a vector pointing up\n\n#### `camera.box(lo, hi)`\nTargets the camera at a bounding box.  This is a short cut for skipping some of the boilerplate associated with lookAt\n\n* `lo` is the lower bound on the box\n* `hi` is the upper bound on the box\n\n#### `camera.rotate(yaw, pitch, roll)`\nApplies an incremental rotation to the camera\n\n* `yaw` is the amount to rotate about the y-axis (in xz plane of camera)\n* `pitch` is the amount to rotate about the x-axis (in yz plane of camera)\n* `roll` is the amount to rotate about the forward axis (in xy plane of camera)\n\n#### `camera.pan(dx, dy, dz)`\nApplies a relative motion to the camera, moving in view coordinates\n\n* `dx,dy,dz` are the components of the camera motion vector\n\n#### `camera.translate(dx, dy, dz)`\nTranslates the camera in world coordinates\n\n* `dx,dy,dz` are the components of the translation vector\n\n## Tuning parameters\n\n#### `camera.distanceLimits`\nA 2D array representing the `[lo,hi]` bounds on the zoom distance.  Note that `0 < lo < hi`.\n\n#### `camera.flipX`\nA flag controlling whether the camera rotation is flipped along the x-axis\n\n#### `camera.flipY`\nA flag controlling whether the camera rotation is flipped along the y-axis\n\n#### `camera.delay`\nThe amount of delay on the interpolation of the camera state in ms\n\n#### `camera.rotateSpeed`\nCamera rotation speed scaling factor\n\n#### `camera.zoomSpeed`\nCamera zoom speed scaling factor\n\n#### `camera.translateSpeed`\nCamera translation speed scaling factor\n\n#### `camera.element`\nThe DOM element the camera is attached to\n\n# License\n(c) 2015 Mikola Lysenko. MIT License\n","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"time":{"modified":"2022-06-23T01:46:21.953Z","created":"2015-03-14T20:24:14.023Z","1.0.0":"2015-03-14T20:24:14.023Z","1.0.1":"2015-03-14T20:41:29.822Z","1.0.2":"2015-03-14T21:27:28.614Z"},"homepage":"https://github.com/mikolalysenko/orbiter","keywords":["orbit","quaternion","arcball","camera"],"repository":{"type":"git","url":"https://github.com/mikolalysenko/orbiter.git"},"author":{"name":"Mikola Lysenko"},"bugs":{"url":"https://github.com/mikolalysenko/orbiter/issues"},"license":"MIT","readmeFilename":"README.md"}