Skip to content

Commit

Permalink
MWM
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor committed Jul 27, 2010
2 parents 78688ed + 495ddfc commit 1e596aa
Show file tree
Hide file tree
Showing 30 changed files with 308 additions and 846 deletions.
7 changes: 1 addition & 6 deletions demos/acorn/acorn.asc
Expand Up @@ -57504,9 +57504,4 @@
3.195539 -2.933579 9.74251 80 56 32 0.089399 -0.129458 0.987547
3.195539 -2.805503 9.74251 80 56 40 0.105032 -0.066927 0.992214
3.195539 -2.6774240000000002 9.74251 80 56 40 0.145090 0.073766 0.986665
3.195539 -2.549348 9.74251 72 48 24 0.223254 0.128481 0.966256





3.195539 -2.549348 9.74251 72 48 24 0.223254 0.128481 0.966256
69 changes: 0 additions & 69 deletions demos/acorn/acorn.html

This file was deleted.

41 changes: 27 additions & 14 deletions demos/acorn/acorn.js
@@ -1,3 +1,4 @@
var acorn;
var ps;

var buttonDown = false;
Expand All @@ -7,7 +8,7 @@ var rot =[0,0];
var curCoords = [0,0];

/*window.onresize = function(){
ps.resize(window.innerWidth, window.innerHeight);
ps.resize(window.innerWidth/2, window.innerHeight/2);
ps.background([0,0,0,1]);
ps.pointSize(5);
};*/
Expand All @@ -32,7 +33,8 @@ function clearPNG(){
}

function zoom(amt){
zoomed += amt * 2;
var invert = document.getElementById('invertScroll').checked ? -1: 1;
zoomed += amt * 2 * invert;
if(buttonDown){
addPNG();
}
Expand All @@ -49,8 +51,8 @@ function mouseReleased(){
}

function keyDown(){
document.getElementById('key').innerHTML = key;
ps.println(key);
document.getElementById('key').innerHTML = key;
ps.println(key);
}

function render() {
Expand All @@ -71,24 +73,35 @@ function render() {

ps.rotateY(rot[0]);
ps.rotateX(rot[1]);

ps.attenuation( $("#constant").slider("value"),
$("#linear").slider("value"),
$("#quadratic").slider("value"));

document.getElementById('const').innerHTML = $("#constant").slider("value");
document.getElementById('lin').innerHTML = $("#linear").slider("value");
document.getElementById('quad').innerHTML = $("#quadratic").slider("value");

var c = acorn.getCenter();
ps.translate(-c[0],-c[1],-c[2]);

// redraw
ps.clear();
ps.render();

var status = document.getElementById('fileStatus');

switch(acorn.status){
case 1: status.innerHTML = "status: STARTED";break;
case 2: status.innerHTML = "status: STREAMING";break;
case 3: status.innerHTML = "status: COMPLETE";break;
default:break;
}


var fps = Math.floor(ps.frameRate);
if(fps < 1){
fps = "< 1";
}

window.status = ps.frameRate;
window.status = acorn.getPointCount() + " points @ " + fps + " FPS";
}

function start(){
ps = new PointStream();
document.getElementById('debug').innerHTML += "XB PointStream Version: " + ps.getVersion();

ps.setup(document.getElementById('canvas'), render);

Expand All @@ -100,5 +113,5 @@ function start(){
ps.onMouseReleased = mouseReleased;
ps.keyDown = keyDown;

ps.loadFile({path:"acorn.asc", autoCenter: true});
acorn = ps.loadFile({path:"acorn.asc", autoCenter: true});
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 1e596aa

Please sign in to comment.