Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hivivo/first-person-controls
First person controls for Three.js in ES6
https://github.com/hivivo/first-person-controls
controls es6 fps threejs
Last synced: 4 months ago
JSON representation
First person controls for Three.js in ES6
- Host: GitHub
- URL: https://github.com/hivivo/first-person-controls
- Owner: hivivo
- Created: 2018-02-27T04:48:47.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-28T05:47:07.000Z (almost 7 years ago)
- Last Synced: 2024-10-02T10:06:41.905Z (4 months ago)
- Topics: controls, es6, fps, threejs
- Language: JavaScript
- Size: 57.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Three.js / First person controls
[![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]
**First person controls** written in **ES6** for [**Three.js**](http://threejs.org/) as UMD.
## Installation
```bash
npm install --save first-person-controls
```## Usage
#### ES6
```javascript
import FirstPersonControls from 'first-person-controls'const controls = new FirstPersonControls(camera)
controls.lookSpeed = 0.1
controls.movementSpeed = 10const clock = new THREE.Clock(true)
const render = () => {
requestAnimationFrame(render)controls.update(clock.getDelta())
}render()
```#### ES5
```javascript
var THREE = require('three');
var FirstPersonControls = require('first-person-controls');var controls = new FirstPersonControls(camera);
controls.lookSpeed = 0.1;
controls.movementSpeed = 10;var clock = new THREE.Clock(true);
var render = function() {
requestAnimationFrame(render);controls.update(clock.getDelta());
};render();
```## License
MIT © [Mr.doob](http://mrdoob.com/), [AlteredQualia](http://alteredqualia.com/) and [Paul Irish](http://paulirish.com/).
[npm-image]: https://badge.fury.io/js/first-person-controls.svg
[npm-url]: https://npmjs.org/package/first-person-controls
[daviddm-image]: https://david-dm.org/hivivo/first-person-controls.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/hivivo/first-person-controls