# Why should you do homogenization after clipping?

Is it just so you avoid unnecessary divisions or are there other advantages as well?

I've just implemented the Sutherland–Hodgman clipping algorithm and read online that you should do homogenization after clipping to avoid divisions and to "avoid messy special cases". Now I wanted to ask if someone knows what they mean by "messy special cases".

One good reason to do clipping in homogeneous space is that the perspective division loses the distinction between regions behind the camera and in front of the camera. Points in front of the camera have $w > 0$, and behind the camera $w < 0$. After dividing by $w$, points behind the camera get mapped (with a sign flip) to the same $x, y, z$ NDC space as those in front of the camera. So it is no longer possible to tell the difference; the original sign of $w$ is lost.
This implies that at least the $w$ clipping must be done in homogeneous space. For instance, triangles that have one vertex behind the camera must get clipped by the $w = 0$ plane to form a quad. Otherwise, you end up with a bizarre object called an "external triangle"—a triangle that appears in two pieces, both extending to infinity, originating from the in-front-of-camera and behind-camera regions of the original homogeneous triangle.