Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 3.了解灯光的位置_Javascript_Three.js - Fatal编程技术网

Javascript 3.了解灯光的位置

Javascript 3.了解灯光的位置,javascript,three.js,Javascript,Three.js,我已经尝试了大约30分钟,试图在我的模型底部放置一个点光源,但效果很差。我不知道我的模型有多少个单位,而且在大多数情况下,我似乎无法准确定位场景中的灯光 我尝试在我的点光源的确切位置添加一个立方体,但不知何故,在我的场景中添加另一个几何体会破坏我的主要对象的纹理更新功能,所以我想这是不可能的 有关于如何精确定位灯光的提示吗 我的代码位于查看源:每个几何体都有一个boundingSphere属性,您可以使用该属性计算对象的大小。 如果属性没有值,可以使用geometry.computeBoundi

我已经尝试了大约30分钟,试图在我的模型底部放置一个点光源,但效果很差。我不知道我的模型有多少个单位,而且在大多数情况下,我似乎无法准确定位场景中的灯光

我尝试在我的点光源的确切位置添加一个立方体,但不知何故,在我的场景中添加另一个几何体会破坏我的主要对象的纹理更新功能,所以我想这是不可能的

有关于如何精确定位灯光的提示吗


我的代码位于查看源:

每个几何体都有一个
boundingSphere
属性,您可以使用该属性计算对象的大小。 如果属性没有值,可以使用
geometry.computeBoundingSphere()计算它

对于每种灯光类型的灯光,都有一个与之关联的辅助功能,它将向您显示灯光的位置:

https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/HemisphereLightHelper
https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/DirectionalLightHelper
https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/PointLightHelper
https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/SpotLightHelper

每个几何体都有一个
boundingSphere
属性,可用于计算对象的大小。 如果属性没有值,可以使用
geometry.computeBoundingSphere()计算它

对于每种灯光类型的灯光,都有一个与之关联的辅助功能,它将向您显示灯光的位置:

https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/HemisphereLightHelper
https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/DirectionalLightHelper
https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/PointLightHelper
https://threejs.org/docs/index.html?q=Helper#Reference/Extras.Helpers/SpotLightHelper