http://dis.dankook.ac.kr/lectures/cg07/entry/lighting-예제
shading model – GL_FLAT/GL_SMOOTH
shademodel.cpp
if (shading == GL_FLAT)
glShadeModel(GL_FLAT);
else if (shading == GL_SMOOTH)
glShadeModel(GL_SMOOTH);
glPushMatrix();
glTranslatef(-1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glColor3f(1, 0, 0); // red
glVertex3f(-1, -1, 4);
glColor3f(0, 1, 0); // green
glVertex3f(1, -1, 4);
glColor3f(0, 0, 1); // blue
glVertex3f(0, 1, 4);
glEnd();
glPopMatrix();
glPushMatrix();
glTranslatef(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glColor3f(0, 0, 1); // blue
glVertex3f(-1, -1, 4);
glColor3f(0, 1, 0); // green
glVertex3f(1, -1, 4);
glColor3f(1, 0, 0); // red
glVertex3f(0, 1, 4);
glEnd();
glPopMatrix();
gluQuadrics을 lighting을 사용한 예와 사용하지 않은 예
glutShapes을 lighting을 사용한 예와 사용하지 않은 예