that is the proper function call (vector, by the way, represents the color of the object, in rgba format)
be warned, this does not add to the lighting calculations to any of the other objects. if all you have is an object with a GL_EMISSION component, and no lights, you will be able to see that object, but not any others in the scene. it simulates what the object would look like if it emits light, but does not actually make the object emit light (i think, that it just adds a color component to the object that is unaffected by ambient and diffuse lighting)
if you want the sphere to actually illuminate other objects in the scene, you are going to have to put a point light inside the sphere (dont worry, the light will pass through it, openGL does not take into account other polygons when calculating light, that is why shadows are such a pain : )
to make the light fade out over a distance, you are going to have to set its attenuation. there are three values for the attenuation: GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, GL_QUADRATIC_ATTENUATION. set them like you would any other light component:
glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, value); //light0 should be whichever light you want to change
here is the formula that gl uses to calculate the overall attenuation factor:
attFactor= 1/(constantAtt + (linearAtt * distance) + (quadradicAtt * distance squared))
that is gonna be hard to read, but hopefully, you can play around with it and figure it out…
<edit>
GL_CONSTANT_ATTENUATION defaults to 1, the other two default to 0…
</edit>
[This message has been edited by Spiral Man (edited 11-01-2001).]