Street light and shadow in opengl?
To make the scene a street light, I tried a point light, used glMaterial, and used ambient light.
I get a scene fully lit, not quite like street light, can anyone share resources or explain exactly how I can achieve this?
I went through many light resources on the net, couldn't get it right.
a source to share
You probably want to use what OpenGL considers a spot of light - this allows you to "aim" at the light and specify how much the light falls as you move away from where it indicated.
Note that if you want the light itself to appear on the scene, you have to draw it yourself - when you specify a light position, OpenGL uses that in its lighting calculations for other objects in the scene, but it does not try to paint any bright area in this part of the scene to show the light itself.
Drawing a real light source can be quite tricky - not only do you need to show the light itself, but at least some amount of "glow" around it (if you want technical information, the amount should vary depending on things like moisture and dust in the air, but most people don't really try to figure it out).
a source to share