Jump to content
  • Advertisement
Sign in to follow this  
kanas

OpenGL laoding lighting

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello there . is there any implementation to load lighting into opengl , if i desigend an 3ds object with 3D MAX ????? THX

Share this post


Link to post
Share on other sites
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 source

glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);



make sure you disable lighting when you are done with it... HTH

Share this post


Link to post
Share on other sites
maybe you should define your light:

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

and then:

glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!