title: OpenGL: no light for a simple glut cube
body: <p>OpenGL: no light for a simple glut cube</p>
  
  <p>Hi, i'm trying to study lights in opengl and glut but I have problems quite early. I have this code for making a lighted cube in a custom position with custom camera setting:</p>
  
  <pre><code>void testApp::draw(){
      static float amb[] =  {0.4, 0.4, 0.4, 0.0};
      static float dif[] =  {1.0, 1.0, 1.0, 0.0};
      
      float light_diffuse[] = {1.0, 0.0, 1.0, 1.0}; 
      float light_position[] = {-1.0, 1.0, 1.0, 0.0}; // i tried a lot of positions here!
      
      // set camera
      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();
      gluLookAt(0, 200, 1200, 0,0,0, 0,1,0);
  
      // set lights
      glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
      glLightfv(GL_LIGHT0, GL_POSITION, light_position);
      glEnable(GL_LIGHT0);
      glEnable(GL_LIGHT1);
      glEnable(GL_LIGHTING);
      glMaterialfv(GL_FRONT, GL_AMBIENT, amb);
      glMaterialfv(GL_FRONT, GL_DIFFUSE, dif);
  
      // draw scene
      ofScale(50, 50, 50);
      glPushMatrix();
  
      glutSolidCube(2);
  
      // close everything
      glPopMatrix();
      glDisable(GL_LIGHT0);
      glDisable(GL_LIGHT1);
      glDisable(GL_LIGHTING); }
  </code></pre>
  
  <p>I see only a black cube, no light, I think the problem is the light position, I've tried a lot of positions but it does not work: black cube. </p>