creating a point light source


I posted about this below but not sure now if my subject was accurate. I am looking for an example of doing this (creating a pt light src) that can be applied to a sphere rendered by gluSphere (not sure if this matters but thought I would mention).

I’d appreciate any info anyone could give asap.

Thanks very much!

Just to see if I understand correctly, you want to make it appear that your gluSphere is emitting light?

There are a couple of things you need to do if this is the case.

  1. Create a light at the same location as your sphere. (Using glLight* functions to set the position, etc.)
  2. Draw your sphere at that location, giving it an emissive material color. (Using the glMaterial* functions)

If you just do number 2, your sphere will appear to be giving off light for itself, but it won’t actually light anything else, thus the need to put number 1 in there.

Yes, this is what I was looking for.

Yeah, right now have been given a sample with just the sun giving off light on itself only
(I believe).

Thanks a lot.