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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -