I dunno how your render things, but a cool trick for camera transformations is to rotate / move the world instead of the cam. This way, the equation for the projection is much simpler as it takes less parameters, and you just have to apply translation / rotation to the points (or shapes) in the world.