How to make a lamp post light up?
Hi,
I have created a lamp post which is supposed to light up at night. It is made up of a cylinder(the base) and a sphere.
How do I create the effect of the lamp post lighting up at night?
I placed a light source at the position of the sphere and adjusted the diffuse values. But the entire scene is lighted up instead.
I also tried using emissive materials for the sphere but it did not have the "lighting up" effect.
You need to setup the attenuation parameters...
Check out basic opengl tutorials!
nehe.gamedev.net or google.com
Check out basic opengl tutorials!
nehe.gamedev.net or google.com
Consider disabling lighting (or just specific lights) for the rest of your scene, so only the lamp post will be illuminated.
When you create a light, one of the functions takes a parameter that points to four values. If you want a positional light, the last value is 1 and the other three values are the position of the light. If the last value is 0, then it means the light is directional and the other 3 values are a light-vector.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement