When you look at a solid three dimensional object, you do not see all of the surface of the object — parts of the surface are hidden from your view by other parts of the object. For example, the following sketch shows, schematically, a ray of light leaving your eye and hitting the surface of the object at the light dot. The object is solid, so the light cannot penetrate any further. But, if it could, it would follow the dotted line, hitting the surface of the object three more times. Your eye can see the light dot, but cannot see the other three dark dots.
Recreating this effect in computer generated graphics is called “hidden-surface elimination”. In general, implementing hidden-surface elimination can be quite complicated. Often a technique called “ray tracing” is used. However, it is easy if you know about vectors and gradients, and you are only looking at a single convex body. By definition, a solid is convex if, whenever two points are in the solid, then the line segment joining the two points is also contained in the solid.
So suppose that we are looking at a convex solid, that the equation of the surface of the solid is and that our eye is at
First consider a light ray that leaves our eye and then just barely nicks the solid at the point as in the figure on the left below. The light ray is a tangent line to the surface at So the direction vector of the light ray, is tangent to the surface at and consequently is perpendicular to the normal vector, of the surface at Thus
Now consider a light ray that leaves our eye and then passes through the solid, as in the figure on the right above. Call the point at which the light ray first enters the solid and the point at which the light ray leaves the solid
Let be a vector that has the same direction as, i.e. is a positive multiple of, the vector
Let be an outward pointing normal to the solid at It will be either or
Let be an outward pointing normal to the solid at It will be either or
Then
at the point where the ray enters the solid, which is a visible point, the direction vector points into the solid. The angle between and the outward pointing normal is greater than so that the dot product But
at the point where the ray leaves the solid, which is a hidden point, the direction vector points out of the solid. The angle between and the outward pointing normal is less than so that the dot product
Our conclusion is that, if we are looking in the direction and if the outward pointing normal to the surface of the solid at is then the point is hidden if and only if
This method was used by the computer graphics program that created the shaded figures in Examples
1.7.1 and
1.7.2, which are reproduced here.