python - Point light range in OpenGL -
i using python opengl, lighting doesn't work correctly. there 1 point light:
gllightfv(gl_light1, gl_position, (-26.5, -17.0, 17.0, 1.0)) gllightfv(gl_light1, gl_spot_direction, 0.0) gllightfv(gl_light1, gl_spot_cutoff, 180.0) gllightfv(gl_light1, gl_spot_exponent, 50.0) gllightfv(gl_light1, gl_constant_attenuation, 50.0) i see nil color of ambient lighting. because didn't set range of light, how can that?
after digging legacy opengl documentation, of parameters kind of suspect:
gl_spot_direction vector. pass single float value, need pass vector 3 float values instead. direction lite source pointing. gl_spot_cutoff should between 0.0 , 90.0. value 180.0 using disables spotlight. seek 45.0 instead. gl_constant_attenuation divides intensity of lite give value. since specify 50.0, lite intensity 2% of total value, create effect close unnoticeable. seek much smaller value, illustration leaving @ 1.0. check out lighting chapter in freely available online version of reddish book diagrams , more detailed explanations of these parameters: http://www.glprogramming.com/red/chapter05.html#name4.
python opengl range point lighting
No comments:
Post a Comment