setFocalLength method

void setFocalLength(
  1. double focalLength
)

Sets the FOV by focal length in respect to the current .filmGauge.

By default, the focal length is specified for a 35mm (full frame) camera.

Implementation

void setFocalLength(double focalLength){

		// see http://www.bobatkins.com/photography/technical/field_of_view.html
		final vExtentSlope = 0.5 * getFilmHeight() / focalLength;

		fov = (180.0 / math.pi) * 2 * math.atan( vExtentSlope );
		updateProjectionMatrix();

	}