title: Three.js set object opacity/transparent
body: <p>I am creating a scene with some parts which are loaded from a JSON file.
  I can hide and show every single object. But now I want to set the opacity/transparent for a single object.</p>
  
  <p>I creating the objects with this code.</p>
  
  <pre><code>    geometryArray = new Object();
      var loader = new THREE.JSONLoader();
      for(var i = 0; i &lt; jsonFileNames.length; i++){
          var layerName = jsonFileNames[i].split("/")[1].slice(0, -5);
          loader.load(layerName, jsonFileNames[i], function(geometry, materials, layerName){
              mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({vertexColors: THREE.FaceColors, side:THREE.DoubleSide, transparent: true}));
              mesh.scale.set(scaleFactor, scaleFactor, scaleFactor);
              mesh.name = layerName;
              scene.add(mesh);
              geometryArray[layerName] = mesh;
          }, layerName);
      }
  </code></pre>
  
  <p>And I can show/hide the objects with this code</p>
  
  <pre><code>geometryArray[layerName].visible = true;
  </code></pre>
  
  <p>But how can I set the opacity/transparent for an object?</p>
  
  <p>I have tried to work with this code but this doesnt work.</p>
  
  <pre><code>geometryArray[layerName].materials[0].opacity
  </code></pre>