Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jwdunn1 authored Sep 14, 2019
1 parent 9ae0568 commit 9dcc5ef
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ Original (presumed abandoned) fork source: https://github.com/diwi/p5.EasyCam
## Usage

```javascript
var easycam;

function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);

easycam = createEasyCam();
// easycam = new Dw.EasyCam(this._renderer);
// easycam = new Dw.EasyCam(this._renderer, {distance:300, center:[0,0,0]});
// easycam = new Dw.EasyCam(this._renderer, {distance:300, center:[0,0,0], rotation:[1,0,0,0]});
createEasyCam();
}

function draw(){
Expand All @@ -59,7 +53,15 @@ function draw(){
box(200);
}
```
something to play with: [jsfiddle](https://jsfiddle.net/intrinsica/n95sgbvr/)
Mouse left-drag will rotate the camera around the subject, a right drag will zoom in and out, and a middle-drag will pan. A double-click restores the camera to its original position.

The camera is positioned on a sphere whose radius is a given distance from the look-at point. Rotations are around the looked-at point.

EasyCam is impervious to gimbal lock, and has no known “singularities” or discontinuities in its behavior.

Simple examples to play with:
- [jsfiddle](https://jsfiddle.net/intrinsica/n95sgbvr/)
- [p5editor](https://editor.p5js.org/jwdunn1/sketches/Awjm6VpHo)


## Reference
Expand Down

0 comments on commit 9dcc5ef

Please sign in to comment.