I am using Three.js to create an animation of 100 cubes. For each cube I set its geometry and material and then add it to the scene with: scene.add(cube); I have been storing the positions of the cubes in three arrays: cube_x[99] cube_y[99] cube_z[99]
I do not know how to tell the renderer their positions as they are modified. The following works for one cube when I have only one cube in the scene:
cube.position.x=300; cube.position.y=000;
I tried making cube into an array to hold the xyz positions of 100 cubes. But I can not seem to call scene.add(cube[i]);
How can I update the position of 100 cubes after scene.add(cube); How do I let three.js know which cube I am trying to move?
Thanks - javascript beginner