Defining Light Coordinates
Posted
by Zachary
on Stack Overflow
See other posts from Stack Overflow
or by Zachary
Published on 2010-03-11T19:16:29Z
Indexed on
2010/03/11
19:19 UTC
Read the original article
Hit count: 399
I took a Computer Graphics exam a couple of days ago which had extra credit question like the following:
A light can be defined in one of two ways. It can be defined in world coordinates, e.g. a street light, or in the viewer (eye coordinates), e.g., a head-lamp worn by a miner. In either case the viewpoint can freely change. Describe how the light should be transformed different in these two cases.
Since I won't get to see the results of this until after spring break, I thought I would ask here.
It seems like the analogies being used are misleading - could you not define a light source that is located at the viewers eye in world coordinates just as well as you could in eye coordinates? I've been doing some research on how OpenGL handles light, and it seems as though it always uses eye coordinates - the ModelView matrix would be applied to any light in world coordinates.
In that case the answer may just be that you would have to transform light defined in world coordinates into eye coordinates using something like the ModelView matrix, while light defined in eye coordinates would only need to be transformed by the projection matrix.
Then again I could be totally under thinking (or over thinking this).
Another thought I had is that it determines which way you render shadows, but that has more to do with the location of the light and its type (point, directional, emission, etc) than what coordinates it is represented in.
Any ideas?
© Stack Overflow or respective owner