Understanding the near clipping plane I don't understand something about the near clipping plane. It's there to avoid the division by $0$ but when we compute the pixel coordinates, we just need to multiply by the clipping plane to clip the object?

For example in this code, from https://www.scratchapixel.com/lessons/3d-basic-rendering/3d-viewing-pinhole-camera/implementing-virtual-pinhole-camera

pScreen.x = pCamera.x / -pCamera.z * near; 
pScreen.y = pCamera.y / -pCamera.z * near; 

Vec2f pNDC; 
pNDC.x = (pScreen.x + r) / (2 * r); 
pNDC.y = (pScreen.y + t) / (2 * t); 
pRaster.x = (int)(pNDC.x * imageWidth); 
pRaster.y = (int)((1 - pNDC.y) * imageHeight); 

bool visible = true; 
if (pScreen.x &lt; l || pScreen.x &gt; r || pScreen.y &lt; b || pScreen.y &gt; t) 
    visible = false; 

return visible; 


When do they actually discard points that have a z component smaller than the near clipping plane? They just discard those which have a x and y coordinate not visible to the screen.
When do they actually discard points that have a z component smaller than the near clipping plane?


For actual rendering hardware, they don't. Clipping happens in clip space, before the NDC transform. "Points" outside of the clipping volume are never seen by the rasterizer (in theory, at least. In practice, guard-band clipping is often used to minimize the need for clipping against the sizes).

The renderer presented at that site doesn't appear to do clipping at all. It has an approximation of what would be clipped, but it doesn't actually do the clipping.