Jump to content
  • Advertisement
Sign in to follow this  
KumGame07

Lighting (Help)

This topic is 4096 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, I have a stupid question.. I want to draw a light source on my scene. I have drawn a small cylinder for that purpose. Now, I want to place the light source inside the cylinder and get a glowing effect (inner surface of the cylinder should glow). I have placed the light source exactly inside the cylinder. But the inner surface doesn't glow. Any idea how to get this? (Should I generate normals myself so that only the inner surface is lit !!!) FYI, I have used a GLUQuadricObj for drawing cylinder and I have enabled SMOOTH normals. Thanks in advance, KumGame

Share this post


Link to post
Share on other sites
Advertisement
Hey, thanks for the reply.

I got it working.. Initially I had rotated the cylinder by 90 degree about X axis (clockwise). When I rotated in anti-clockwise direction, everything worked fine.
I'm still wondering how would I know whether I have to rotate clockwise or anti-clockwise?

Regards,
KumGame

Share this post


Link to post
Share on other sites
Well, im not sure how you rotated it and how your scene looks like, and if you rotate your light at the same time. But sometimes, culling can make it difficult when trying out stuff, try disabling culling and see what happens:

glDisable (GL_CULL_FACE);

But, this shouldnt make any difference...

Share this post


Link to post
Share on other sites
Quote:

Well, im not sure how you rotated it and how your scene looks like, and if you rotate your light at the same time. But sometimes, culling can make it difficult when trying out stuff, try disabling culling and see what happens:


Thanks.

I do not rotate the light. I set the position of the light prior to doing transformations on other objects in the scene. Moreover, I have not enabled culling. I should cross check the defaults though ;)

Regards,
KumGame

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!