Movable "light" in 3d enviroment

42 Views Asked by At

A light-emitting object is suspended in a 3 dimensional environment at a known position (eg: X=0, Y=0, Z=10). The object emits light with a certain beam pattern; it is not omnidirectional. The center of the beam is most intense; intensity drops off (for example) logarithmically in a circular pattern. The object can be rotated to aim this beam anywhere on the X-Y plane (Z=0). What equations can be used to determine the light intensity at a given point on the X-Y plane?

Ideally, the result would be something that can be correlated to a color pattern for visualization. eg: 0 for no light, 10 for brightest light or something like that. Hoping to use a spreadsheet to manipulate the equation(s) and visualize the results. Eventually, more than one object will be calculated and the results plotted together.

Thanks!

1

There are 1 best solutions below

2
On

If the beam pattern is really rotationally symmetric, your task is easy. The intensity is a function of only two parameters: distance and cosine of the angle between the point and the axis of the light. Thus, a light at

$$\vec{r}_0=(X,Y,Z)$$ with a unit vector direction $\vec{n}$, and a test point $$\vec{r}=(x,y,z)$$ give you the distance $$d=|\vec{r}_0-\vec{r}|=\sqrt{(x-X)^2+(y-Y)^2+(z-Z)^2}$$ and $$\cos\phi=\frac{(\vec{r}-\vec{r}_0)\cdot\vec{n}}{d}$$ (dot product of two vectors).

The intensity of light at $\vec{r}$ is then $$\frac{A}{d^2}f(\cos\phi)$$ when $f$ is your arbitrary function (it could use arccos to get the angle, or do whatever you wish). The inverse-square law still aplies if the light is small (point-like), hence $\frac{1}{d^2}$.

Of course, you want the irradiance (or whatever the appropriate photometric quantity is, there are too many to keep track of), so you need to further multiply by a cosine of the incident angle to the illuminated surface. Which, of course, you get the same way as before: $$\cos\theta=\frac{(\vec{r}_0-\vec{r})\cdot\vec{N}}{d}$$ if $\vec{N}$ is the normal to the surface at the point $\vec{r}$.

This is pretty standard for all raytracing and raster rendering algorithms. Usually, the surface itself doesn't only multiply by a cosine to get the incident irradiance, but also has a shader that determines how the light is actually reflected back to the camera (for instance, phong highlights, brilliance exponent and so on).