I have read from Hearn and Baker computer graphics book. I read the test#2 painter's theorem which image is given below. Painter's theorem of test#2 image from Hearn and Baker

This image showing surface S is completely behind the surface S', by checking Substitute the coordinates of all vertices of S(x, y,z) into the plane equation of S' and check for the sign. If all vertices of S are inside S' then S is behind S'. (Fig. 1).

i. e. Ax + By+ Cz + D < 0 ,x, y, z are S vertices.

But I have read from this websites which showing this concepts but in totally opposite manner. See this image I read from that site, which showing opposite thing on same image. This showing all vertices of S are outside of S'.

i. e. Ax + By+ Cz + D > 0 ,x, y, z are S vertices.

My question is how is it possible Hearn and Baker saying S is completely inside the surface S' but my mentioned website saying S is outside of S' by sign test of plane equation?


Solution 1:

The equation of a plane is $$A x + B y + C z + D = 0 \tag{1}\label{BtV1}$$ where $(A, B, C)$ is the plane normal vector (direction perpendicular to the plane), and $-D$ is the signed distance between origin and the plane, in units of the plane normal vector length.

Note that we can multiply $A$, $B$, $C$, and $D$ by any nonzero real $\lambda$ (i.e., $0 \ne \lambda \in \mathbb{R}$), without affecting the plane at all.

The related equation $$A x + B y + C z + D \gt 0 \tag{2}\label{BtV2}$$ defines a half-space. Essentially, the plane divides the Euclidean plane into two, and this equation is true for one of the half-spaces; specifically, the one in the direction the plane normal vector $(A, B, C)$ points to.

That choice is arbitrary. Using $\lt$, we just choose the opposite half-space.

Sometimes, we choose the half-space the plane normal vector points to ($\gt$), and sometimes the half-space the plane normal vector points away from ($\lt$). Both are mathematically equally valid.

If we multiply $A$, $B$, $C$, and $D$ in $\eqref{BtV2}$ by $-1$, all we do is replace the plane normal vector with its opposite. To keep pointing at the same half-space, we then need to also change $\gt$ into $\lt$ and vice versa.

Thus, the difference between $\lt$ and $\gt$ in $\eqref{BtV2}$ is just a result of the free choice in choosing how the plane normal vectors are defined. If they point away from the observer/camera, then increasing values are further away. If they point towards the observer/camera, then decreasing values are further away. Both are equally valid, since it is just an arbitrary choice in direction.