| |||||||||||
|
Main Menu Other |
Tutorials -- Drawing Triangles | ||||||||||
|
The Code (con't)Now we'll get into lighting.
GLfloat LightAmbient[] = { 0.75f, 0.75f, 0.75f, 1.0f};
GLfloat LightDiffuse[] = { 1.0f, 1.0f, 1.0f, 0.9f};
GLfloat LightSpecular[] = { 0.8f, 0.8f, 0.8f, 1.0f};
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, LightSpecular);
This code first sets our variables for lighting up our scene. I'm not much of an expert on this, but using these gives a good effect. You can tweak around with them to see what happens, which can make things appear different colors and stuff. Later I'll have a tutorial on lighting, like positional vertex lighting, and even light maps once I figure those out. =]
|
|||||||||||