Now I have a bucle for which add objects to a scene:
for (var i = 0; i < DEMOS.length; i++) {
var geometry = new THREE.PlaneGeometry(1.5 * SCALE, 1 * SCALE);
var texture = loader.load('url');
var material = new THREE.MeshBasicMaterial({map: texture});
var plane = new THREE.Mesh(geometry, material);
plane.position.x = positions[i][0]
plane.position.y = positions[i][1]
plane.position.z = positions[i][2]
plane.lookAt(camera.position);
scene.add(plane)
}
I would like to update this objects when a asyncronous event be fired, for example to change the image of the texture I have to save this obj into an array?
Oh you’re right, sry. But changing objects afterwards using callbacks or event listener is no big deal. You are using ordinary JavaScript features for this. Have a look at the official examples to see some code samples.
Besides, the following manual page describes three.js specific things you have to care about: