OpenGL: Fixing Dull Looking Objects

Do your objects look dull or dark when they are turned around? Then, maybe you have missed out on updating the light position.

The light position can be updated by using the glLight() OpenGL calls:

glLightfv( GL_LIGHT0, GL_POSITION, lightPos );

Typically, the light position can be set to the same as the eye position, that is updated to the gluLookAt() call to setup the camera.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.