title: Alternating materials on one object
body: <p>I'm a beginner using <code>three.js</code> and I am trying to have two materials defined on one single object, and alternate between the two using a visibilty flag, but with no success. 
  Is there another way, or can this be done?</p>
  
  <pre><code>var materials = [
      new THREE.MeshPhongMaterial( { color: 0x00ff00,visible:true, shininess: 1 } ),
      new THREE.MeshPhongMaterial( { color: 0xff0000,visible:false, shininess: 1 } )
  ];
  
  obj= THREE.SceneUtils.createMultiMaterialObject( geometry, materials );
  scene.add( obj);
  
  scene.traverse(function (node){
      if(node instanceof THREE.Mesh) {
          node.visible =!node.visible;
      }
  });
  </code></pre>
  
  <p>I will entually aplly this to all objects in the scene that's why I'm using the scene.traverse</p>