1.0.0 • Published 10 years ago

turntable-camera v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

turntable-camera experimental

A turntable camera for use in 3D scenes. Useful as a limited alternative to orbit-camera in specific cases.

Usage

NPM

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 for details.