mrdoob/three.js — Issue #1212: Proposed Change to PerspectiveCamera.setLens() 
Author: WestLangley
Created: 2012-01-29 20:34:43+00:00
State: open

... and also to CombinedCamera.setLens().

The PerspectiveCamera.setLens routine is:

``` javascript
THREE.PerspectiveCamera.prototype.setLens = function ( focalLength, frameSize ) {

frameSize = frameSize !== undefined ? frameSize : 43.25; // 36x24mm

this.fov = 2 * Math.atan( frameSize / ( focalLength * 2 ) );
this.fov = 180 / Math.PI * this.fov;

this.updateProjectionMatrix();

}
```

In Three.js, the parameter `fov` is the field-of-view in the vertical direction.

Therefore, when using this routine to set the `fov` parameter, the `frameSize` parameter must represent the vertical frame size.

Furthermore, if we are emulating a 35mm camera (as implied by the inline comment) the default value for `frameSize` should be 24, the frame height. (The current default value of 43.25 is the diagonal length.)

Also, to avoid confusion, perhaps `frameSize` should be renamed `frameHeight`.

Suggestion:
1. rename `frameSize` to `frameHeight`
2. set the default value to 24