Three.js: 设置TextGeometry枢轴点

创建于 2012-02-27  ·  3评论  ·  资料来源: mrdoob/three.js

嗨,我想知道如何在TextGeometry中使用lookAt()方法。
我只看到一个用于放置文本的技巧:

var centerOffset = -0.5 * ( textGeo.boundingBox.max.x - textGeo.boundingBox.min.x );
textMesh1.position.x = centerOffset;

但是,如果我将lookAt()与文本对象一起使用,它将从左下角旋转。

TextGeometry包裹在Object3D中无济于事..或者至少我失败了。

我也有兴趣为其他几何设置基点。

感谢您的帮助。

Question

最有用的评论

现在,您可以使用: textGeo.center();

所有3条评论

在生成TextGeometry之后,您应该使用THREE.GeometryUtils.center( geometry )将中心点居中。

宏伟,你。

现在,您可以使用: textGeo.center();

此页面是否有帮助?
0 / 5 - 0 等级