Lighting problem
Greetings all,
The problem I am have is when there is an object that can be rotated in my scene, only the front facing side is lit, the other sides seem rather dark. Could it be my normals calculation is off or something? Any suggestions to fix this is surely appreciated? Thx!
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
-----------------------------"There are ones that say they can and there are those who actually do.""...u can not learn programming in a class, you have to learn it on your own."
I''m not good in lighting but is your position not so placed that it''s only shining on the front side?
Are you using ambient or specular?
Are you using ambient or specular?
I''m not very good in lighting either 
but it may be your normal calculations (again I dont know very much about lighting
can we see the code you are using to calculate them? Sometimes a sign error or a little mistake can cause everything to screw up

but it may be your normal calculations (again I dont know very much about lighting

can we see the code you are using to calculate them? Sometimes a sign error or a little mistake can cause everything to screw up

I am not good at lighting either.I have went back to the basic cubed and tried making a simple cube to see if I could find out the problem. Not successful yet. Only the code that pertains to the problem is included, hopefully
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
Edited by - cMADsc on March 3, 2002 5:38:52 PM
|
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
Edited by - cMADsc on March 3, 2002 5:38:52 PM
-----------------------------"There are ones that say they can and there are those who actually do.""...u can not learn programming in a class, you have to learn it on your own."
try this ...
Edited by - Shag on March 3, 2002 5:49:09 PM
Edited by - Shag on March 3, 2002 5:49:39 PM
|
Edited by - Shag on March 3, 2002 5:49:09 PM
Edited by - Shag on March 3, 2002 5:49:39 PM
its the normals, dont ask me why but its always the normals 
but seriously been a while since i was programming but they look wrong to me, cant remember how to calculate the damn things anymore but you should check up on them... and dont use GL_POLYGON its sloooooow use triangle strip or fan

but seriously been a while since i was programming but they look wrong to me, cant remember how to calculate the damn things anymore but you should check up on them... and dont use GL_POLYGON its sloooooow use triangle strip or fan
Ok, I will try it out. Hope it works! Although, I did notice when I added the "glLoadIdentity()", in the function RenderScene, I had to increment the rotation of the cubed substanionally compared to before. Big difference.
without glLoadIdentity;
if(keys[VK_RIGHT])//right arrow key has been pushed
{
yRot+= 0.02f;//angle incremented
}
//////////////////////////////////////////////
with glLoadIdentity;
if(keys[VK_RIGHT])//right arrow key has been pushed
{
yRot+= 0.302f;//angle incremented
}
Edited by - cMADsc on March 3, 2002 6:03:44 PM
without glLoadIdentity;
if(keys[VK_RIGHT])//right arrow key has been pushed
{
yRot+= 0.02f;//angle incremented
}
//////////////////////////////////////////////
with glLoadIdentity;
if(keys[VK_RIGHT])//right arrow key has been pushed
{
yRot+= 0.302f;//angle incremented
}
Edited by - cMADsc on March 3, 2002 6:03:44 PM
-----------------------------"There are ones that say they can and there are those who actually do.""...u can not learn programming in a class, you have to learn it on your own."
I went back and recalculated the normals and lighting problems are corrected!! Thanks again!!!!
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
-----------------------------"There are ones that say they can and there are those who actually do.""...u can not learn programming in a class, you have to learn it on your own."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement