PDA

View Full Version : Light Problem



mehran20
07-02-2005, 10:08 PM
Another confusing situation!!
I've used GLUT library in my program to draw spheres and cones and I also have some lights in space. Funny part is that, the objects drawn by GLUT are affected by light and the polygons that I've drawn are not!! My polygons are rendered flat with no highlights.
What could be the problem, since all the objects are drawn in the same situation (they are few lines apart)?

Thanks,

Ehsan Kamrani
07-03-2005, 02:13 PM
When you use from the GLUT objects, you don't need to specify the normal vectors. But when you draw your own polygons, you should specify their normal vectors. In lighting, the direction of the light, orientation of the normal vectors and/or the direction of the viewr are so important.
-Ehsan-

mehran20
07-03-2005, 09:11 PM
Thanks alot Ehsan, I didn't know. That does it.

CWestWolf
07-06-2005, 02:04 PM
Oh, Thanks too, normal is important to light...