gpt4 book ai didi

three.js - 三个js对象的单位是什么?

转载 作者:行者123 更新时间:2023-12-04 10:01:22 24 4
gpt4 key购买 nike

var camera = new THREE.PerspectiveCamera(
35, // Field of view
800 / 640, // Aspect ratio
.1, // Near
10000 // Far
);

var cube = new THREE.Mesh(
new THREE.CubeGeometry( 5, 5, 5 ),
new THREE.MeshLambertMaterial( { color: 0xFF0000 } )
);

在相机中,Near和Far参数的单位是什么。

在Cube中,CubeGeometry的参数单位是什么

请指出我的网址,我可以在其中找到有关的详细信息

对象空间-(用于绘制对象的局部轴)
世界空间-(全局坐标轴)

最佳答案

可以确定这些参数是OpenGL中的单位。如果您查看OpenGL红皮书,则第3章中的每本

http://www.glprogramming.com/red/chapter03.html

这里有一个简短的段落:

The preceding paragraph mentions inches and millimeters - do these really have anything to do with OpenGL? The answer is, in a word, no. The projection and other transformations are inherently unitless. If you want to think of the near and far clipping planes as located at 1.0 and 20.0 meters, inches, kilometers, or leagues, it's up to you. The only rule is that you have to use a consistent unit of measurement. Then the resulting image is drawn to scale.



因此,要回答您的问题,单位就是您认为应该的单位,它们纯粹是相对比例。

关于three.js - 三个js对象的单位是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11386243/

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