Advertisement

Two side lighted polygon

Started by October 30, 2002 03:33 AM
1 comment, last by The Snake 22 years, 4 months ago
Hi! Out of a dataset I created an hollow object, which consists of many triangles. I want the light to be shining as well on the inside as the outside of the object. One side is pretty easy. I just created a normal for every polygon. To get the other side I just multiplied the values of the vector with -1.0f But how can I get the light shining on both sides of the object at the same time?
never mind, found it. for those who are interested:

glLightModelf( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE )
Advertisement
Also note that this model allow you to have different material properties for front-facing and back-facing polygons.
And be careful : this method only works for polygons , neither lines nor points (nor bitmaps) are affected by this setting.

This topic is closed to new replies.

Advertisement