?
Solved

Spotlights in OpenGL

Posted on 2002-03-27
6
Medium Priority
?
308 Views
Last Modified: 2013-12-26
I am trying to make a streetlight in a program I am working on and I have all the code to make the light, point it in the right direction and everything works fine. What I want is to be able to see the light...or in other words make the actual light semi-transparent. I have done this before but I can't remember the parameters I used to do it...

Thanks,

Patterson
0
Comment
Question by:Patterson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Expert Comment

by:joachimc
ID: 6912996
You should probably use some kind of additative effect for it.

/Joachim
0
 
LVL 3

Author Comment

by:Patterson
ID: 6913642
float ambience[4] = {0, .1, .1, 1.0};
float g_LightPosition[4] = {164, 5, 10, 1};

glLightfv( GL_LIGHT0, GL_AMBIENT,  ambience );
glLightfv( GL_LIGHT0, GL_POSITION, g_LightPosition );

float light1_diffuse[4] = {1, 1, 1, 1};
float light1_pos[4] = {380, -75, 30, 1};
float light1_direction[4] = {(float)-380/388.5, (float)75/388.5, (float)-30/388.5};

glLightfv( GL_LIGHT1, GL_POSITION, light1_pos );
glLightfv( GL_LIGHT1, GL_SPOT_DIRECTION, light1_direction);
glLightf( GL_LIGHT1, GL_SPOT_CUTOFF, 45);
glLightf( GL_LIGHT1, GL_CONSTANT_ATTENUATION, .2);
glLightfv( GL_LIGHT1, GL_DIFFUSE, light1_diffuse);

glLightf(GL_LIGHT1, ...);

From what I remember it was just a one line function call from glLightf.

Thanks,

Patterson

0
 
LVL 1

Expert Comment

by:effectstudios
ID: 6936440
I am not sure but maybe it has something to do with fog.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
DreamMaster earned 800 total points
ID: 6936601
Maybe this is of use to you?

It discusses most of the different options you have with glLightf and glLightfv

http://www.listensoftware.com/lamp.html

Max.
0
 
LVL 3

Author Comment

by:Patterson
ID: 6937159
That's what I was looking for...

Thanks,

Patterson
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6937416
Glad to have been helpfull Patterson...

Thanks for the Grade A.. :)

Max.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question