Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Spotlights in OpenGL

Posted on 2002-03-27
6
Medium Priority
?
314 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 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