ThreeJS如何移动场景的中心协调?(ThreeJS How to move the center coordination of the scene?)

编程入门 行业动态 更新时间:2024-10-10 23:19:32
ThreeJS如何移动场景的中心协调?(ThreeJS How to move the center coordination of the scene?)

我试图将场景的中心从网格的中心X移动到最低的x点(地面交叉点)? 因为我需要使用Raycaster根据中心(0,0,0)检查交叉点?

I am trying to move the center of the scene from the center X of the mesh to the lowest x point (floor intersection) ? as I need to inspect intersection point according to the center (0,0,0) using Raycaster ?

最满意答案

如果geometry.boundingBox未定义,那么你可以通过计算它

geometry.computeBoundingBox ()

它更新了geometry.boundingBox属性。

然后,您可以使用geometry.boundingBox.min和geometry.boundingBox.max来计算移动模型的数量。

if geometry.boundingBox is undefined then you can compute it by

geometry.computeBoundingBox ()

which updates the geometry.boundingBox attribute.

Then you can use geometry.boundingBox.min and geometry.boundingBox.max to figure out how much to move your model.

更多推荐

本文发布于:2023-04-29 08:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335623.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:场景   中心   ThreeJS   move   scene

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!