I'm having a bit of trouble getting my floor to light up at all.
Here's a screen: http://img194.imageshack.us/my.php?image=picture41fq.png
The light is built using the code:
float light_position[4] = {0.0f, 1.1f, 0.0f, 1.0f};
float light_ambient[4] = {0.0f, 0.0f, 0.0f, 1.0f};
float light_specular[4] = {0.0f, 1.0f, 0.0f, 1.0f};
float light_diffuse[4] = {0.0f, 1.0f, 0.0f, 1.0f};
float spot_cutoff = 45.0f
float spot_direction[] = {0.0f, -1.0f, 0.0f} // down at the floor
As you can see, the model is lighting up fine under the spotlight. (The cube is just there to make the light's position more obvious) However, the floor isn't lighting up at all.
I set up the floor's material properites using this code, and pass the normal of (0, 1, 0) for each vertex on the floor
Edit: I am also specifying the floor vertices in counter-clockwise order.
float light_properties[] = {0.6f, 0.6f, 0.6f, 1.0f};
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, light_properties);
glBindTexture(GL_TEXTURE_2D, *m_pTextureManager->GetTexture(floor));
glBegin(GL_QUADS);
// etc
How do I get it to light up in the spotlight like the model does? I thought that giving it the mateiral properties that I do should work.
[Edited by - Foobar of Integers on April 22, 2006 3:28:58 PM]
"ok, pac man is an old gameand, there are faces which is eatin up shits" - da madface