views:

292

answers:

1

I have a spotlight that I'm attempting to use, however when I move forward and get to a specific spot (before I reach the object) the light gets cut off and disappears. Does anyone know what could be causing this, or direct me to a good tutorial that would show me how to make sure it didn't do this?

I'm attempting to simulate a flashlight. Here is the line that sets up the spotlight

glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 30.0f);

Thanks.

+2  A: 

Does your geometry have enough polygons? OpenGL fixed functionality only does shading equations for each vertex (not for each pixel like per-pixel lighting), so if your polygons are very large, the behavior may appear incorrect.

Tronic