laoding lighting

Started by
1 comment, last by vlad_tepes 19 years ago
hello there . is there any implementation to load lighting into opengl , if i desigend an 3ds object with 3D MAX ????? THX
Advertisement
With OpenGL you just have to turn on lighting with a few functions and make sure your model has normals setup or you have to calculate them so OpenGL knows how to light the model correclty.

glEnable(GL_LIGHTING);glEnable(GL_LIGHT0);//then use this to position your light sourceglLightfv(GL_LIGHT0, GL_POSITION, lightPosition);


make sure you disable lighting when you are done with it... HTH
maybe you should define your light:

GLfloat LightAmbient[] = { 0.5, 0.5, 0.5, 1.0 };

and then:

glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);
--- we hit the highscore ---www.Gamag.org

This topic is closed to new replies.

Advertisement