Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/turntable-camera
A turntable camera for use in 3D scenes
https://github.com/hughsk/turntable-camera
Last synced: 12 days ago
JSON representation
A turntable camera for use in 3D scenes
- Host: GitHub
- URL: https://github.com/hughsk/turntable-camera
- Owner: hughsk
- License: other
- Created: 2014-09-07T23:43:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-07T23:43:53.000Z (about 10 years ago)
- Last Synced: 2024-10-17T16:41:12.635Z (22 days ago)
- Language: JavaScript
- Homepage: http://hughsk.io/turntable-camera/
- Size: 195 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# turntable-camera [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)
A turntable camera for use in 3D scenes. Useful as a limited alternative
to [orbit-camera](http://github.com/mikolalysenko/orbit-camera) in specific
cases.## Usage
[![NPM](https://nodei.co/npm/turntable-camera.png)](https://nodei.co/npm/turntable-camera/)
### camera = TurntableCamera()
Creates a new turntable camera instance.
### camera.view([data])
Calculates and returns a 4x4 view matrix based on the camera's current
configuration. Optionally, you can pass in your own `data` array to update
too.### camera.rotation
The rotation the camera should make around the Y axis, in radians.
### camera.center
An `[x, y, z]` array, referring to the center (or, "focal point") of the camera.
### camera.distance
The camera's distance from the focal point along the XZ plane.
### camera.downwards
The angle for the camera to look downwards, in radians. Note that this will also
effect the Y position of the camera, and hence its overall distance from the
focal point.## License
MIT. See [LICENSE.md](http://github.com/hughsk/turntable-camera/blob/master/LICENSE.md) for details.