Skip to content

Commit

Permalink
k key wireframe alternating
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedekorte committed Nov 14, 2013
1 parent ed6483f commit 53e47e0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
45 changes: 44 additions & 1 deletion hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,52 @@ $(document).bind('keydown', 'x', function(e) {
Mode.rotating = !Mode.rotating
})


$(document).bind('keydown', 'c', function(e) {
camera.position.x = 0;
camera.position.y = 0;
camera.position.z = 1500;
resetCameraRot()
camera.lookAt({x:0,y:0,z:0});
})

$(document).bind('keydown', 'v', function(e) {
camera.position.x = 1500;
camera.position.y = 1500;
camera.position.z = 1000;
resetCameraRot()
camera.lookAt({x:0,y:0,z:0});
})

$(document).bind('keydown', 'b', function(e) {
camera.position.x = -1500;
camera.position.y = -1500;
camera.position.z = 1000;
resetCameraRot()
camera.lookAt({x:0,y:0,z:0});
})


$(document).bind('keydown', 'n', function(e) {
camera.position.x = 2500;
camera.position.y = 0;
camera.position.z = -1000;
resetCameraRot()
camera.lookAt({x:0,y:0,z:0});
})


$(document).bind('keydown', 'm', function(e) {
Mode.rotateCamera = !Mode.rotateCamera
if (!Mode.rotateCamera) { resetCameraRot() }
})

$(document).bind('keydown', 'k', function(e) {
Mode.alternateWireframe = !Mode.alternateWireframe
})

resetCameraRot = function()
{
camera.rotation.x = 0;
camera.rotation.y = 0;
camera.rotation.z = 0;
}
15 changes: 13 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
//PI = 3.14159265359

var container;
var t = 0

var camera, scene, renderer;

Expand Down Expand Up @@ -100,7 +101,7 @@

function setupBlur()
{
return
if (THREE.EffectComposer == null) { return }
console.log("THREE.EffectComposer = " + THREE.EffectComposer)
composer = new THREE.EffectComposer( renderer );
composer.addPass( new THREE.RenderPass( scene, camera ) );
Expand All @@ -109,7 +110,7 @@

function prepareBlur()
{
return
if (THREE.EffectComposer == null) { return }
hblur = new THREE.ShaderPass( THREE.HorizontalBlurShader );
composer.addPass( hblur );

Expand Down Expand Up @@ -186,6 +187,7 @@
side: THREE.DoubleSide
})

//var circle = new THREE.CircleGeometry( 10, 6, 0, Math.PI * 2 )
var circle = new THREE.CircleGeometry( 10, 6, 0, Math.PI * 2 )
//var object = new THREE.Mesh(circle, fill_material);
var object = new THREE.Mesh(circle, wireframe_material);
Expand All @@ -212,10 +214,19 @@
{
requestAnimationFrame( animate );
render();

if (Mode.rotateCamera)
{
camera.rotation.z += .1
}

t = t + 1
}

function render()
{
if (Mode.alternateWireframe) { Mode.isWireframe = !Mode.isWireframe }

var bins = Spectrum.timeStep()
//console.log("bins: " + JSON.stringify(bins))
var timer = Date.now() *.009
Expand Down

0 comments on commit 53e47e0

Please sign in to comment.