Skip to content

Commit

Permalink
added minor fixes and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor authored and Andor committed May 12, 2011
1 parent 10825e7 commit c230ac5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
7 changes: 1 addition & 6 deletions demos/acorn/acorn.js
@@ -1,15 +1,11 @@
var ps, acorn;

// Create an orbit camera halfway between the closest and farthest point
var cam = new OrbitCam({closest:10, farthest:20, distance: 200});
var cam = new OrbitCam({closest:10, farthest:20, distance: 20});

var isDragging = false;
var rotationStartCoords = [0,0];

var zoomed = -50;
var rot = [0, 0];
var curCoords = [0, 0];

function addPNG(){
var img = document.createElement('img');
img.setAttribute("width", "100");
Expand All @@ -27,7 +23,6 @@ function removeAllScreenShots(){

function zoom(amt){
var invert = document.getElementById('invertScroll').checked ? -1: 1;
zoomed += amt * 2 * invert;

if(amt < 0){
cam.goCloser(-amt);
Expand Down
16 changes: 9 additions & 7 deletions demos/lion/lion.js
@@ -1,19 +1,21 @@
var ps, lion;

// mouse control
var buttonDown = false;
var zoomed = -50;
var rotationStartCoords = [0, 0];
var isDragging = false;

// Create an orbit camera halfway between the closest and farthest point
var cam = new OrbitCam({closest:10, farthest:50, distance: 50});
var rotationStartCoords = [0, 0];
var isDragging = false;

const KEY_ESC = 27;

function zoom(amt){
var invert = document.getElementById('invertScroll').checked ? -1: 1;
zoomed += amt * 2 * invert;

if(amt < 0){
cam.goCloser(-amt);
}
else{
cam.goFarther(amt);
}
}

function mousePressed(){
Expand Down

0 comments on commit c230ac5

Please sign in to comment.