Need help on a very simple prob
Hi all
I m a newbie to OpenGL. I have drawn a disc using glu and now i want it to be lit from both the sides( by default only one normal is defined which makes it glow from one side only :( )
I know its simple for u guyz..... but it would b a gr8 help to me
thnx
Though I've never messed with it myself, I think you need to enable 2 sided lighting, a google would probably tell you how, hope that helps :)
there can be many ligths, but a surface(or vertex) only needs one normal. just position the lights correct, and it lights up on the sides where the ligths are.
If I understand your problem correctly, you want both sides of each face to be lit. As Thought suggested, this is a setting that can be modified.
Try:
glDisable( GL_CULL_FACE );
This should make sure both sides of every face are drawn. Then, don't specify normals when you are drawing. This "should" draw them both equal. I'm not sure how this is defined if you specify lights, though. If you disable lighting, though, I would think that this would work for you.
If there are different / better solutions (there most likely are) please feel free to correct me.
- Enosch
Try:
glDisable( GL_CULL_FACE );
This should make sure both sides of every face are drawn. Then, don't specify normals when you are drawing. This "should" draw them both equal. I'm not sure how this is defined if you specify lights, though. If you disable lighting, though, I would think that this would work for you.
If there are different / better solutions (there most likely are) please feel free to correct me.
- Enosch
Quote:Original post by EnoschYou're right that face culling will need to be disabled to see the back faces, but what Th0ughtCr1me was referring to is two-sided lighting. You can set this with glLightModel*.
If I understand your problem correctly, you want both sides of each face to be lit. As Thought suggested, this is a setting that can be modified.
Try:
glDisable( GL_CULL_FACE );
This should make sure both sides of every face are drawn. Then, don't specify normals when you are drawing. This "should" draw them both equal. I'm not sure how this is defined if you specify lights, though. If you disable lighting, though, I would think that this would work for you.
If there are different / better solutions (there most likely are) please feel free to correct me.
- Enosch
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement