什么是“中心”? Three.js对象? [英] What is the "center" of a Three.js object?

查看:117
本文介绍了什么是“中心”? Three.js对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Blender建模对象时,我可以显式定义其发生平移和旋转的中心位置。当使用Three.js对象时,我似乎找不到对应的对象。

When I use Blender to model an object, I am able to explicitly define its center position from which translations and rotations occur. When working with Three.js objects, I don't seem to find an equivalent.

Three.js对象是否具有定义其中心位置的属性?如果没有,如何确定对象的中心?

Does a Three.js object have a property that defines its "center" position? If not, how is the the center of the object determined?

推荐答案

在three.js中,对象的中心是

In three.js, an object's "center" is the origin in the object's local coordinate system.

如果对象未围绕所需的点旋转,则需要平移几何图形的顶点,以便所需的中心为

If your object is not rotating around the point you want, then you need to translate the vertices of your geometry so the desired center is at the origin.

geometry.translate( distX, distY, distZ );

请参见此答案以获取更多信息和替代解决方案。

See this answer for more information and an alternate solution.

three.js r.78

three.js r.78

这篇关于什么是“中心”? Three.js对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆