How to make a lamp post light up?

Started by
3 comments, last by dpadam450 17 years, 8 months ago
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.
Advertisement
You need to setup the attenuation parameters...
Check out basic opengl tutorials!

nehe.gamedev.net or google.com

"Game Maker For Life, probably never professional thou." =)
Consider disabling lighting (or just specific lights) for the rest of your scene, so only the lamp post will be illuminated.
Make sure you are using Diffuse lighting instead of Ambient one.
OpenGL fanboy.
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.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement