Light a beizer grid

I have made a simpe 4 point controlled beizer grid… I think they are called so. anyway it is a grid from the base and controll points so I can make it curved smoothly.

I have filled the grid with red color. and it looks great but when I set up a light the grid is white… but only when I use ‘auto normalize’. when I turn it of it looks like the light isn´t there…

and one thing I verry new in OpenGL programming… I started with my first rotating cube for about 4 weeks agoo, so I haven´t done any lightning at all so everything might be wrong.

You may be having problems with your material setup. When you start doing lighting, the normal glColor3f commands stop working, instead you need to specify material propertys, e.g. colour, alpha, shineness, reflectiveness… There is however a way round it, what you need to do is specify the current material in such a way that it tracks the current colour, I can’t remember the command at the moment, but I know it is somewhere in the lighting section of the Red Book.

When you say you are using “auto normalize” do you mean you are enabling GL_AUTO_NORMAL, or GL_NORMALIZE? They are two different things. The first is what you want to generate normals for the glMap* functions.

I use GL_AUTO_NORMAL but I have tried GL_NORMILIZE to when GL_AUTO_NORMAL is on the color is white and no shadows or anything, and when I turn GL_NORMILIZE on it is red like the lights never turned on.

As tdavie said, you need to set the material properties rather than using the glColor* functions when you enable lighting. Not sure why using GL_NORMALIZE would change your object from white to red, That basically just forces normals to a length of 1 after transformations, I think. I would think that if you aren’t using a material your surface would be a blended gray, which is what the default material color is.

I think it is something like glEnable(GL_COLOR_TRACK) or something like that.