Hi
every thing in my scene appears to have be the same color as the floor - I’m not using texture mapping - how can I sort this out?
cheers
Hi
every thing in my scene appears to have be the same color as the floor - I’m not using texture mapping - how can I sort this out?
cheers
Try to have a look at
glColor3f()
it changes the color for all vertices drawn after this call
so for example to draw a nice rainbow triangle
glColor3f(1.0f, 0.0f, 0.0f)
glVertex2f(1.0f, 0.0f)
glColor3f(0.0f, 1.0f, 0.0f)
glVertex2f(-1.0f, 0.0f)
glColor3f(0.0f, 0.0f, 1.0f)
glVertex2f(0.0f, 1.0f)
I forgot to say that for that rainbow triangle, you should have smooth shading enabled(flat shading uses the color of the first or third vertex - sorry, not sure about that - for the whole triangle)
[This message has been edited by Platinum (edited 12-06-2001).]
I actually use glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, SurfaceColour);
If you are using material properties, such as you specified, then make sure that you have properly enabled lighting.
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);