Eventually I realized that the rows variable is what I need to change. I modified that in initializeDataGrid()
Then in place of setInterval(updateData, defaultDuration) I put plotData()
Now I can plot any dataset in an interactive 3D grid yay!
@@ -235,11 +234,13 @@ function scatterPlot3d( parent )
function initializeDataGrid() {
var rows = [];
// Follow the convention where y(x,z) is elevation.
+ //EDIT THIS FOR STATIC DATA!!!
for (var x=-5; x<=5; x+=1) {
for (var z=-5; z<=5; z+=1) {
- rows.push({x: x, y: 0, z: z});
+ rows.push({x: x, y: (x+z)/2, z: z});
}
}
+ rows.push({x: 2.5, y: 0, z: 2.5});
return rows;
}
@@ -259,8 +261,5 @@ function scatterPlot3d( parent )
initializeDataGrid();
initializePlot();
- setInterval( updateData, defaultDuration );
+ plotData();