WASDQE, ARROWS. This is a super fast way to do 3d z-clipping of 3d triangles. It only needs one triangle if two of the points are behind the camera but needs two if only one is (because it needs to fill a quad). I have set the z-clipping distance high for the demo, it should realistically be from ~1-10.
All me :D Feel free to use but with credit! This is how it works - if two points are behind the camera it clips those two points but if one is I clip it with both the other points and fill a quad between the four points. Tags: #z #clipping #3d #triangle #filler #renderer