I just did a tutorial from videotutorialsrock.com on lighting in C++ OpenGL. I understand ambient light, but don't understand the difference between positioned light and direct light, since the idea and the code of both looked very similar. Here's my code for positioned light:
//Add positioned light
GLfloat lightColor0[] = {.6, .6, .6, 1};
GLfloat lightPos0[] = {4, 0, 8, 1};
glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor0);
glLightfv(GL_LIGHT0, GL_POSITION, lightPos0);
And for directional light:
//Add direct light
GLfloat lightColor1[] = {.5, .2, .2, 1};
GLfloat lightPos1[] = {-1, .5, .5, 0};
glLightfv(GL_LIGHT1, GL_DIFFUSE, lightColor1);
glLightfv(GL_LIGHT1, GL_POSITION, lightPos1);
Could someone explain?