Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antouhou/first-person-camera
https://github.com/antouhou/first-person-camera
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/antouhou/first-person-camera
- Owner: antouhou
- Created: 2014-11-10T08:41:06.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-14T11:47:38.000Z (about 10 years ago)
- Last Synced: 2023-02-26T13:46:42.715Z (almost 2 years ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#first-person-camera
###What is that?
first-person-camera is a (obviously) first-person camera and controls for [three.js](http://threejs.org/).
###Usage
add this script to your html after three.js, and then:
`var camera = new FirstPersonCamera();`
and then add to your scene render function:
`camera.update();
renderer.render(scene,camera.object);`###Options
movementSpeed - movement speed. Defaults to 1.
rotationSpeed - rotation speed. Defaults to 0.02.
canFly - allow camera change it y position by moving forward/backward. Defaults to false.
defaultPosition - default position for camera. Defaults to {x: 0, y:10, z: 0}
targetObj = a THREE.Object3D to place right before camera. It can be a sight, for example. Defaults to empty Object3D.
###Controls
It has classical first-person shooter camera controls - move your mouse to change camera direction, and WASD to move.