• Advertisement

Archived

This topic is now archived and is closed to further replies.

Light problem

This topic is 6385 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

I''m trying to create a 3d fp engine, and I want to put some light in it. But I''ve got some problems. I want the light to stay where I placed it no matter where the player are (that seems logic), but I can''t even see where the light are. I''ve placed the glLightfv; glEnable; in the draw screen function after the glRotatef; glTranslatef; stuff and before the glBegin(GL_QUADS); stuff. But when I open the game the light is fucked up. When a corner of a rectangle not is on the screen the light for the rest of the rectangle gets fucked up, and sometimes when I face in one direction there''s alot of light and when i face in another direction there''s no light at all the same place where there was alot of light before. Does anyone know what i''m doing wrong? Thanx Zredna p.s. Do I have to do some trick to get shades or will they come automaticly when I get the light to work?

Share this post


Link to post
Share on other sites
Advertisement
Do you give openGL the normal?? Are the normal correct???? And the materials????

If yes, yes and yes, try to get an example that creates and manages lights and compare it to your code.

cya

PROgrammer

Share this post


Link to post
Share on other sites
Sorry shadows are up to you.

Take care of you parameters and go check out Opengl.org and nehe.gamedev.net to see more informations about lighing.



-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites
You are experiencing this problem cause you probably didn''t specified the normals to OGL.
You have to do it in the manner you find in Nehe''s tutorials. If you have to do it automatically you must calculate them for each poly, nad them normalize the values.
You can do it using glEnable(GL_NORMALIZE) to normalize the unnormalized normals.
I hope this help.

//-------------
Making Funny Garbage Codes on
http://members.xoom.it/NinjaCross

Share this post


Link to post
Share on other sites

  • Advertisement