THREE.js - Change property of one, all object change -
i have issue. put properties in spheres array opacity/visible etc.. when (in mousedown event) want change 1 sphere property, of them change. don't understand why... describe part of code.
for (var = 0; < data.nodes.length; i++) { //coordinates of spheres , others properties spheres[i].material.transparent=true; spheres[i].material.opacity=0.2; scene.add(spheres[i]); force.start(); } spheres[anyone].material.opacity=0.8;
sorry, english not good. thank in advance!
i suspect due spheres using same material instance, therefore changing 1 change them all.
adding unique materials each of spheres overcome problem.
Comments
Post a Comment