Yeh it’s a bit of a weird one. I must be doing something dumb.
I started off the program by rendering my scene as a mesh using GL_LINE_STRIP in green to get a feel for the contours and it all looked great. I then switched to GL_TRIANGLE_STRIP in preparation for shading and obviously with that I get one massive green blob.
I then moved on to calculating normals and finally defining my light sources and then switching on the lights. The lights are defined as
GLfloat ambient[] = {0.5,0.5,0.5,1.0};
GLfloat diffuse[] = {0.8,0.8,0.8,1.0};
GLfloat lightpos1[] = {-40.0,100.0,-10.0,1.0};
GLfloat lightpos2[] = {40.0,100.0,80.0,1.0};
What’s weird is that it the shading all works nicely and it fills all the polygons as they should be, but in greyscale! It’s like my specification to draw the polygons in green is completely ignored. As soon as I turn off the lights, then it draws in green again but with no shading, which is obviously pointless! TIA for any help.