Three.js - Fisheye effect

前端 未结 5 1422
渐次进展
渐次进展 2021-02-03 15:12

So, I\'ve messed around with three.js, works out great. The only thing I can\'t figure out, is how to make a camera with a real fisheye effect.

How is that possible?

5条回答
  •  清歌不尽
    2021-02-03 15:53

    A wide angle lens generally have a very low focus length.

    To achieve an extreme wide angle we need to reduce focus length.

    Note that fish eye lens is an extreme wide angle lens.

    To reduce focus length(or to achieve extreme wide angles), one can just increase FOV (field of view), as FOV is inversely proportional to focus length.

    example:

    var camera_1 = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );
    
    var camera_2 = new THREE.PerspectiveCamera( 80, width / height, 1, 1000 );
    

    Here camera_2 is a wider angle setup.

    Note

    To achieve desired effect, one may have to adjust camera position.

提交回复
热议问题