gpt4 book ai didi

javascript - Three.js 中的相机参数

转载 作者:行者123 更新时间:2023-12-03 12:22:50 26 4
gpt4 key购买 nike

这是相机的实例化方式:

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

这些值是什么意思?

最佳答案

我想知道同样的事情,所以我查了一下,这是一个 View “平截头体” .

我将在此处粘贴我在最近的一个项目中编写的代码注释,因为它很好地总结了恕我直言。

// "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).

Wikipedia image

关于javascript - Three.js 中的相机参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10716632/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com