PDA

View Full Version : Lines without Normals



TomPandolfi
02-15-2002, 02:58 PM
When I draw lines they are bright in some directions and dim in others. I tried turning off Lighting but then the line lost its color and showed as white.

How can I create lines that have non directional lighting?

MrShoe
02-15-2002, 07:46 PM
Im pretty sure that lines cant be lighted... By definition a line in 3D space cannot have a normal vector and without a normal vector i dont see how your going to do lighting.

Korval
02-15-2002, 08:01 PM
Im pretty sure that lines cant be lighted... By definition a line in 3D space cannot have a normal vector and without a normal vector i dont see how your going to do lighting.

Not true. OpenGL is perfectly happy to let you send normals with lines. It will perform the appropriate lighting and goroud shading calculations and goroud shade the line.

What you need to do to turn it off is exactly what you need to do to turn off lighting. However, when you disable lighting, the vertex color comes from the color you specified with glColor, not glMaterial. So, you will need to set the color appropriately after you turn off lighting.