I use the Gouraud system for rendering light to my 3d set and the result is very poor. I think my normals are not correct. I see light on my polygons randomly. If i have a polygon on the (x,z) plane and i specify its normal like this glNormal3d(0.0,1.0,0.0) the reflection is perfect i have no problem so my light is ok but when i use the Gouraud system for more complex polygons i can’t get the good effect. Here is an exemple of what i do.
I would like to know if i have to put negatives attributes to normal ex: (glNormal3d(x1,-y1,z1) depending on the side of the polygon i want to see and know what’s wrong with my code. Thanks
Yeah i know what you are telling me but i think you don’t know th Gouraud interpolation system (and thats better cuz i thinks it suck hehe). I need to know my problem on this topic cause i don’t want to calculate all my normal (i missed time).
gouraud system works by linear interpolation of intensities across scanlines.
if you wish to use gouraud, wich opengl uses by default, you need to specify a color for every vertex.
if you don’t use lighting.
instead, if you use lighting, then you have to specify a normal.
opengl will then apply lighting to the normal, and will find color components that then will be fed to the rasterizer.
loosely speaking.
if you specify a normal equal to the vertex, and you’re rendering a triangle, the normal probably won’t be perpendicular to the surface.
this way, you’ll get wrong lighting.
there are cases where a normal IS equal to the vertex wich it belongs, like with unit spheres.
are you rendering planets or something like that?
however, when developing/debugging, to activate normalization could be helpful.
also is very useful to understand how T&L works, by reading the redbook.
about normal evaluation, you could precalculate them if the geometry is static, and store them into a database.
Dolo//\ightY
[This message has been edited by dmy (edited 03-21-2000).]
Finaly i left the Gouraud interpolation and i’ve made my own fonction to calculate normals and my x-wing (because stars wars is the subject of this lab in an infography course) look good now. Some of my friends use Gouraud. 50% works and the other 50% doesn’t work. The professor could not explain us very well why it doesnt work for everybody so i use my own method and it’s better now. So thanks you all for the reply!