PDA

View Full Version : How can I put some light?

fandecine
11-27-2002, 11:52 AM
Sorry, I am a beginner. I have to implement constant shading for a project without using GL functions. I have to calculate the vector L from my polygon to the light. So my question is: how do I simply put some light (what code should I used to put it at for example at xyz=50,50,50) ?

What3v3r
11-27-2002, 12:59 PM
Put some light without opengl functions !?!?! What ? Well, you can use lightmaps, is that what you want ?

Bye

fandecine
11-27-2002, 01:01 PM
No, I can use GL functions for the light but I can't use them to implement the shading!

In fact my real question is: how can I just put the light using openGL at xyz= 50,50,50 without showing any shade, just the light.

[This message has been edited by fandecine (edited 11-27-2002).]

satan
11-27-2002, 03:27 PM
Originally posted by fandecine:
No, I can use GL functions for the light but I can't use them to implement the shading!

In fact my real question is: how can I just put the light using openGL at xyz= 50,50,50 without showing any shade, just the light.

[This message has been edited by fandecine (edited 11-27-2002).]

I don't get this. Perhaps I am just stupid, but it sounds like you want to implement the shadings yourself, right? Then why do you need a glFunction to place the light?
So I think placing the light could be done like this:

Light.x:=50; Light.y:=50; Light.z:=50;

(Yeah, I am coding Pascal)

Then calculate the necessary light vectors for your vertices and use glColor for the shading. Hope you are allowed to use smooth shading.

If I got everything wrong just forget my post. I said that i didn't understand your question, so it's not my fault http://www.opengl.org/discussion_boards/ubb/wink.gif.