   How to light the inside of a cube made with glutSolidCube()?
  HelloCreating a cube with glutSolidCube() and placing a light source close to it works as expected and the cube is lit.I want to place the light source inside the cube and get the same effect but I guess the cube's normals have to be negated? How do I go about doing that?I am just trying to create a small room (i.e. four walls, a floor and a ceiling) so that I can play around with lighting in OpenGL.Thanks   
  The easiest thing is probably to use two-sided lighting model:glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);This will flip the normals from the front face of the polygons and use them for the back face, which should work with glutCube.   ;Quote:set lighting model to two-sidedI'vfe already tried that but it doesn't work.   ;Quote:it doesn't workBe more specific. You can't see the walls? They are lit incorrectly? The lighting is reversed? The polygons are not being drawn?   ;  The insides of the cube are not lit, like I wanted them to and like I described in my initial post AND subject line.   ;  Are you using the fixed pipeline lighting or are you using shaders?If fixed, GL_LIGHT_MODEL_TWO_SIDE should reverse the normals and work, although it will also use the back material parameters (I never used it, so I'm not sure what this means).If you are using shaders, you will either need to reverse your normal in your vertex shader (ugly in my opinion), or create your own cube creation function with normals pointing inwards (preferred, will also give you more freedom for shape, texture coordinates, etc).   ;  Thanks for the replies but I gave up trying to find how to reverse the normals of glutCube. Instead, I wrote a routine that builds a large quad consisting of smaller quads, calculates the normals and then used that to build my room.Good thing I didn't use glutCube too because with only 2 triangles per face, the lighting wouldn't have been as nice as with my high-poly walls.Anyway, the source is as follows (please don't complain about this being messy, I just wrote it hastily to continue learning about lighting):1. Call CreateRoom() during initialisation2. Call DeleteRoom() at shutdown.3. Call RenderRoom() to render.Note: V3D class has 3 floats (x,y,z) but I didn't provide the source for it.// globals used by some functionsV3D* v = 0; // verticesV3D* n = 0; // normalsfloat l = 0.0f; //length of large quad in terms of smaller quadsfloat roomSize = 0.0f;// to be called during initvoid CreateRoom( float s, float seg ){float r = s / seg;int w = r;   // this prevents the caller from passing parameters that do not divide evenly   // (i.e. s = 10, seg = 2.3, result = BOOM)   // (i.e. s = 10, seg = 2.5, result = OK)if( ( r - w) != 0 )return;   // update the globalsl = s / seg;roomSize = s;   // allocate the vertices/normalsv = (V3D*)malloc( sizeof(V3D) * (l * l) * 4 );n = (V3D*)malloc( sizeof(V3D) * (l * l) * 4 );int i = 0; // vertex counterfor( float y = 0; y < s; y += seg ){for( float x = 0; x < s; x += seg ){v[0+i].Set( x , y , 0.0f );v[1+i].Set( x + seg, y , 0.0f );v[2+i].Set( x + seg, y + seg, 0.0f );v[3+i].Set( x , y + seg, 0.0f );CalculateNormals( i );i+=4;}}}// to be called at shutdownvoid DeleteRoom( void ){free( v );free( n );}// calculates the normals of a quad (one normal FOR EACH vertex)void CalculateNormals( int s ){V3D a1, a2;a1 = v[1 + s] - v[0 + s];a2 = v[3 + s] - v[0 + s];n[0 + s] = a2.Cross( a1 );n[0 + s].Normalise();   // don't need to calculate the rest of the normals...a1 = v[0 + s] - v[1 + s];a2 = v[2 + s] - v[1 + s];n[1 + s] = a1.Cross( a2 );n[1 + s].Normalise();a1 = v[1 + s] - v[2 + s];a2 = v[3 + s] - v[2 + s];n[2 + s] = a1.Cross( a2 );n[2 + s].Normalise();a1 = v[2 + s] - v[3 + s];a2 = v[0 + s] - v[3 + s];n[3 + s] = a1.Cross( a2 );n[3 + s].Normalise();}// render a facevoid DrawFace( void ){int i = 0;for( int a = 0, i = 0; a <((l*l)); a++){  // set the normal once since it is the same for every vertex in the quadglNormal3fv( &n[0 + i].x );glBegin( GL_QUADS );glVertex3fv( &v[0 + i].x );glVertex3fv( &v[1 + i].x );glVertex3fv( &v[2 + i].x );glVertex3fv( &v[3 + i].x );glEnd();i += 4;}}// render the entire room as large cubevoid DrawRoom( void ){glColor3f(1.0f,1.0f,1.0f);DrawFace();glPushMatrix();glRotatef(90.0f,0.0f,1.0f,0.0f);glTranslatef(0.0f,0.0f,roomSize);DrawFace();glPopMatrix();glPushMatrix();glRotatef(90.0f,0.0f,1.0f,0.0f);glRotatef(180.0f,1.0f,0.0f,0.0f);glTranslatef(0.0f,-roomSize,0.0f);DrawFace();glPopMatrix();glPushMatrix();glRotatef(180.0f,1.0f,0.0f,0.0f);glTranslatef(0.0f,-roomSize,roomSize);DrawFace();glPopMatrix();glPushMatrix();glRotatef(90.0f,1.0f,0.0f,0.0f);glTranslatef(0.0f,-roomSize,0.0f);DrawFace();glPopMatrix();glPushMatrix();glRotatef(-90.0f,1.0f,0.0f,0.0f);glTranslatef(0.0f,0.0f,roomSize);DrawFace();glPopMatrix();}