Camera arguments in Three.js

前端 未结 4 1355
说谎
说谎 2021-01-31 05:37

This is how a camera is instantiated:

var camera = new THREE.PerspectiveCamera(
    VIEW_ANGLE,
    ASPECT,
    NEAR,
    FAR
);

What do these

4条回答
  •  梦毁少年i
    2021-01-31 06:03

    I was wondering the same thing so I looked it up, it is a view "frustum".

    I'll paste here a code comment I wrote in a recent project because it sums it up nicely IMHO.

    // "What the f*** is a frustum?" you ask. Well I did.
    // Think about it as a truncated pyramid. The tip is the camera. From a certain
    // point "down" the pyramid (the "near plane"), stuff can be seen on-screen.
    // After the "base" of the pyramid (the "far plane"), stuff is too far to be
    // seen. Stuff outside the pyramid is off-screen too. There is also the "aspect
    // ratio" (the rectangle that makes up the pyramid's base, so this value is
    // width/height) and the "field of view" (think of it as a lens or something,
    // it distorts the pyramid so there's more objects on screen - it is set in
    // degrees and 45° is more-or-less a "natural" perspective. The bigger the
    // number, the more "perspective" there is).
    

                                             

提交回复
热议问题