Skip to content

Commit

Permalink
wireframe on key 8
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedekorte committed Nov 14, 2013
1 parent ae4ea0f commit ccd4d6c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
9 changes: 9 additions & 0 deletions hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ $(document).bind('keydown', '7', function(e) {
Spectrum.gain = 20;
});

$(document).bind('keydown', '8', function(e) {
Mode.isWireframe = !Mode.isWireframe
});

$(document).bind('keyup', '8', function(e) {

});


$(document).bind('keydown', '-', function(e) {
Spectrum.gainFactor -= .05;
});
Expand Down
35 changes: 26 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@

var camera, scene, renderer;

var Mode = {
isWireframe: false
}

$(document).ready(function()
{
init();
Expand All @@ -49,7 +53,6 @@

function init()
{

container = document.createElement( 'div' );
document.body.appendChild( container );

Expand Down Expand Up @@ -77,7 +80,6 @@
setupBindings()
setupGrid()
setupBlur()

}

function setupBlur()
Expand All @@ -103,8 +105,6 @@

function setupGrid()
{
gridRows = []
//var max = 27
var max = 37
var spacing = max*100/27
for (var x = 0; x < max; x++)
Expand Down Expand Up @@ -157,9 +157,9 @@
*/
var wireframe_material = new THREE.MeshBasicMaterial(
{
color: 0x000000,
color: 0xffffff,
wireframe: true,
wireframe_linewidth: 1
wireframe_linewidth: 1
} );

var fill_material = new THREE.MeshBasicMaterial(
Expand All @@ -172,7 +172,8 @@
})

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, fill_material);
var object = new THREE.Mesh(circle, wireframe_material);

object.position.set( 0, 0, 0 );
object.rotation.z = 3.14159
Expand Down Expand Up @@ -226,14 +227,28 @@
var fill_material = new THREE.MeshBasicMaterial(
{
color: color,
wireframe: true,
transparent: false,
wireframe: Mode.isWireframe,
transparent: true,
opacity: 0.95,
side: THREE.DoubleSide,
wireframeLinewidth: 3
})

object.material = fill_material

/*
var mat = object.material
mat.color = color
mat.wireframe = false
mat.transparent = true
mat.opacity = 0.95,
mat.side = THREE.DoubleSide
mat.wireframeLinewidth = 3
mat.needsUpdate = true
*/

//.setColor(new THREE.Color( 0xff0000 )) // new THREE.Color( color )
//object.position.z = bins[i]*3
//object.rotation.x = bins[i]/10
Expand All @@ -251,6 +266,8 @@
*/
var vs = bins[b]/100
var s = vs*vs*vs*vs*vs

if (s < 1) { s = 1 }
object.scale.x = s*.5
object.scale.y = s*.5
//object.rotation.x = Math.cos(s)
Expand Down

0 comments on commit ccd4d6c

Please sign in to comment.