Can anyone explain why they would divide a camera z position by tan(PI/6), instead of just multiplying it by an arbitrary float number?
This is the camera() function in Processing and I am trying to make sense of its default parameters.
syntax
camera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ)
default parameter
camera(width/2.0, height/2.0, (height/2.0) / tan(PI*30.0 / 180.0), width/2.0, height/2.0, 0, 0, 1, 0)
With perspective projection, the projected size of the object depends on the distance to the camera. This is just an empirical formula that should give a suitable distance depending on the height of the window and the field of view.
In perspective projection, the projection matrix describes the mapping of 3D points in the world, as seen from a pinhole camera, onto 2D points in the viewport. The viewing volume is a Frustum.