it looks like my y and z coordinate for the light position are mixed up. before I position my light, it comes from +y (instead of +z) and to ‘fix’ it i have to set its position to {0, 1, 0, 0}. I want to know if I messed up someware or does the light appear to be coming from the top on other peoples computers also?
#include <GLUT/glut.h>
void init(void)
{
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
glClearColor(0, 0, 0, 0);
}
void display(void)
{
GLdouble matrix[16];
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glutSolidTeapot(1);
glFlush();
}
void reshape(int width, int height)
{
glViewport(0, 0, width, height);
glutPostRedisplay();
}
int main(int argc, char *argv[])
{
int i;
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH);
glutCreateWindow("Shit");
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();
return 0;
}