PDA

View Full Version : How can I draw light rays?



cysunshine
03-19-2004, 11:34 PM
I want to draw light rays that emit by spotlight.viz,it's a strong beam of light,and it has a tiny diffuse effect.
How can I represent it through OpenGL?

dorbie
03-22-2004, 11:08 AM
Firstly you generate the illumination effect from the spotlight by using a local light source and defining th espotlight parameters. Then if you want the beam effect from the light passing through dust (or whatever) in the air you can draw transparent blended polygons with a glBlendFunc(GL_ONE, GL_ONE) to give the appearance of a glowing beam. The color values will determine how bright the beam is.

cysunshine
03-22-2004, 09:14 PM
Thanks to your help!