From 9571098b8b40f0f2c3dfcca8a907f260280230af Mon Sep 17 00:00:00 2001 From: palomapalmer97 Date: Mon, 21 Jul 2014 14:10:09 -0700 Subject: [PATCH] voxel scripts voxelwall is an 8x8 wall made of voxels that transitions from a bright red to dark blue voxelsoundwaves was an array of voxels that was manipulated to resemble an audio scope that responds to loudness and changes its height depending on the loudness of the audio that the microphone picks up --- examples/editVoxels.js | 2 +- examples/voxelsoundwaves.js | 226 ++++++++++++++++++++++++++++++++++++ examples/voxelwall.js | 103 ++++++++++++++++ 3 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 examples/voxelsoundwaves.js create mode 100644 examples/voxelwall.js diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 412612fdad..8d2a516f55 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -65,7 +65,7 @@ colors[4] = { red: 236, green: 174, blue: 0 }; colors[5] = { red: 234, green: 133, blue: 0 }; colors[6] = { red: 211, green: 115, blue: 0 }; colors[7] = { red: 48, green: 116, blue: 119 }; -colors[8] = { red: 31, green: 64, blue: 64 }; +colors[8] = { red: 36, green: 64, blue: 64 }; var numColors = 9; var whichColor = 0; // Starting color is 'Copy' mode diff --git a/examples/voxelsoundwaves.js b/examples/voxelsoundwaves.js new file mode 100644 index 0000000000..6de46e23cf --- /dev/null +++ b/examples/voxelsoundwaves.js @@ -0,0 +1,226 @@ + + + +var wallX = 8000; +var wallY = 8000; +var wallZ = 8000;//location + + +var VOXELSIZE=12;//size of each voxel + +var FACTOR = 0.75; + +var loud=1.0; +var maxLoud=500; +var minLoud=200;//range of loudness + + + +var maxB={color:225,direction:0,speed:1}; +var minB={color:50,direction:1,speed:1}; +var maxG={color:200,direction:0,speed:1}; +var minG={color:30,direction:1,speed:1}; +var maxR={color:255,direction:0,speed:1}; +var minR={color:150,direction:1,speed:1};//color objects +var addVoxArray=[]; +var removeVoxArray=[]; +var numAddVox=0; +var numRemoveVox=0;//array for voxels removed and added + + +var height; +var wallWidth=34; +var wallHeight=25; +var maxHeight=wallHeight; +var minHeight=0;//properties of wall + + +var heightSamplesArray=[]; +var sampleIndex=0;//declare new array of heights + +var direction=1; + + + + +//initiate and fill array of heights +for(var k=0;k