One suggestion why you arent seeing what you render with a perspective projection matrix…
When you set up your perspective matrix, the default ‘camera’ position is (0,0,0). You viewing direction is down the -Z axis. This isnt an actual camera, its where you are viewing from in world coordinates.
So my guess is you didnt transform your rendered objects away from the ‘camera’ sufficiently enough to view them.
glTranslatef(0., 0., -10.);
glutSolidSphere(3, 25, 25);
If you are contemplating coding a useable solid modeler, you have your work cut out for you. This is by no means an easy task.