title: Three.js what does computeCentroids do?
body: <p>I was making my own custom geometry with three.js (using typescript). Something was wrong with it, the object appeared all dark with Lambert material. I checked the three.js source code to see if I forgot to do something when creating the geometry. I saw these two lines appear at the end of the constructor of nearly every geometry class: </p>
  
  <pre><code>this.computeCentroids();
  this.computeFaceNormals();
  </code></pre>
  
  <p>Adding the computeFaceNormals solved my problem. I remember something about normals having to do with lighting (so that makes sense).</p>
  
  <p>But I don't know what the computeCentroids does, and where/why those centroids are needed. Can someone explain? Also do I need to call that function? What can happen if I don't?</p>