For a simple way of doing it, you’ll need two things:
First, you’re looking for the Sutherland-Hodgman Clipping algorithm, or some other type of clipping algorithm. Sutherland-Hodgman is very easy to understand and implement, and it is used in some physics engines for this even today. This will clip your shapes given a clipping volume.
The second thing you’re looking for is some background on projection matrices and how the frustum is formed.
Matrices are used by multiplying them with coordinates to produce a transformed set of points. A typical example would be mapping the vertices of the unit cube to the canonical view frustum. Now treat your new frustum as the clipping object from the first step and viola. A decent way of doing it on the CPU.
There are lots of optimizations you can make as well and different approaches such as taking the 6 faces of a box, and instead of transforming their vertices, use the matrix to transform their homogeneous half-space representation for frustum culling