title: OpenGL- Flat Shading without light C++
body: <p>I have already implemented a mesh. It was OK with a wire frame rendering (triangles) but now i want to apply a flat shading rendering and what i get is a figure with no volume, plain white. </p>
  
  <p>here is what i use:</p>
  
  <pre><code>for(int i=0; i&lt;mesh-&gt;nt; i++) {
      glShadeModel(GL_FLAT);
      glBegin(GL_TRIANGLES);
  
  
      int i0 = mesh-&gt;triangles[i].vInds[0];
      int i1 = mesh-&gt;triangles[i].vInds[1];
      int i2 = mesh-&gt;triangles[i].vInds[2];
  
      Vector n1 = GetNormal(mesh-&gt;vertices[i0], mesh-&gt;vertices[i1], mesh-                  &gt;vertices[i2]);
  
      glNormal3dv((double *)&amp;n1);
  
      glVertex3dv((double *)&amp;mesh-&gt;vertices[i0]);
      glVertex3dv((double *)&amp;mesh-&gt;vertices[i1]);
      glVertex3dv((double *)&amp;mesh-&gt;vertices[i2]);
  
      glEnd();
  }   
  </code></pre>
  
  <p>I calculated the normals of the triangles but nothing works.  Any idea?</p>