Sign in to follow this  
KumGame07

Lighting (Help)

Recommended Posts

KumGame07    145
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
KumGame07    145
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
gardin    122
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
KumGame07    145
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this