Model in 3D. Use your transforms to convert to a 2D viewport (window). Scale to screen coordinates.
If you are already clipping in 2D to the viewport, then you only need to clip the polygons in 3D to the viewplane (plane perpendicular to the direction the viewer is looking).
Harder but potentially more efficient is clipping polygons in 3D to the planes from the viewpoint to each of the four viewport sides.
Actually, 3D clipping is too advanced for now. Just keep all your models in positive z space until you have everything else working. And use triangles, not polygons, to simplify rendering. Later you can support rectangles and arbitrary polygons by breaking them down into triangles.