One issue I'm grappling with is a function that keeps getting called, but the vertices aren't updating as expected:
function showGraph() {
requestAnimationFrame(showGraph);
// Transfer frequency data to an array named frequencyData.
analyser.getByteFrequencyData(frequencyData); // The values in frequencyData change over time.
var dat = 79600;
var step = dat/frequencyData.length
var f = 0;
for(v=0; v<dat; v+=step){
globe._baseGeometry.verticesNeedUpdate = true;
globe.points.geometry.verticesNeedUpdate = true;
globe._baseGeometry.vertices[v].z = globe._baseGeometry.vertices[v].z * frequencyData[f]
globe._baseGeometry.vertices[v].y = globe._baseGeometry.vertices[v].y * frequencyData[f]
globe._baseGeometry.vertices[v].x = globe._baseGeometry.vertices[v].x * frequencyData[f]
f++;
}
}
// Execute the loop
showGraph();
If it's enclosed within a $(document).ready(function(){...
block, it runs successfully once. What tweaks are required?