Identify directly illuminated surface of a volume

152 Views Asked by At

Let $s$ be a light source emitting rays located at $[s_x,s_y,s_z]$, a volume $V$. Without loss of generality, I will consider a rectangular volume of sizes $[L_x,L_y,L_z]$.

Assuming the source is located outside the volume, I wish to identify the directly illuminated surface of $V$. By directly, I mean disregarding propagation of light and considering light which moves in a ray manner.

This image illustrates:

enter image description here

In the blue example, only the front face of the volume will be directly illuminated while on the yellow example all 3 visible faces of the volume are illuminated.

Is a mathematical formulation to identify the un-obscured surfaces? I have seen this paper which does the exact same work for a point cloud but I do not know how to alter this method for surfaces.

Any ideas on the matter? Is this at all possible?

2

There are 2 best solutions below

0
On BEST ANSWER

Before the advent of 'Blender' (a software that I highly recommend for 3D-graphics) I used to do 3D-calculations in C++ myself. For surfaces I think the paper you mention is not so well suited. I find it much easier to work with triangulated surfaces.

Here each triangle $(A,B,C)$ comes with an outward normal which you may compute e.g. as $n=\pm \vec{AB} \times \vec{AC}$. The choice of sign indicates which side is potentially visible or illuminated. If your source of light is S and your camera is in position E then the sign of $n \cdot \vec{AS}$ tells you if the side is illuminated and the sign of $n \cdot \vec{AE}$ if the side is visible to the camera. (Here I am thinking of 3D drawings in perspective, although your example doesn't seem to be in perspective. In that case you should replace $\vec{AE}$ by the fixed direction to the camera).

The above works out of the box for convex triangularized polyhedrons. When you have non-convex objects or e.g. several polyhedrons in play which may shadow each other, there is some book-keeping to see if rays from some object intersect another.

Returning to Blender the 'standard' object is a cube but internally it is a surface which has a representation in terms of triangles. This is (in my opinion) simpler and it assures that when you move one single point, the operation is well-defined (it wouldn't be if you use quadrilaterals).

0
On

There are respective domains of combinatorial geometry about illumination and in computer science about visibility, so this problem can be already solved.

The case of a smooth shape $V$ probably will lead to a differential equation for the terminator (I don’t mean that mighty guy), but a case of a convex polyhedral shape $V$ is easy. Namely, the illuminated surface is a union of faces (including their boundaries) and a face is illuminated iff any its inner point is illuminated iff an arbitrary its inner point is illuminated. Assuming that $s$ is outside $V$, any point $p$ of the surface is illuminated iff an open segment $(p,s)$ does not intersect the faces of $V$.