Three.js: set TextGeometry pivot point

Created on 27 Feb 2012  ·  3Comments  ·  Source: mrdoob/three.js

Hi, I wonder how can I use the lookAt() method with a TextGeometry.
I saw only a hack for positioning a text:

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

But If I use lookAt() with text object It rotates from the bottom-left.

Wrapping the TextGeometry in a Object3D does not help either.. or at least I failed..

Im also interested in setting base point for other geometries.

Thanks for helping..

Question

Most helpful comment

Now, you do this with: textGeo.center();

All 3 comments

Right after generating your TextGeometry you should center the pivot using THREE.GeometryUtils.center( geometry ).

magnificent, ty.

Now, you do this with: textGeo.center();

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filharvey picture filharvey  ·  3Comments

seep picture seep  ·  3Comments

donmccurdy picture donmccurdy  ·  3Comments

Horray picture Horray  ·  3Comments

akshaysrin picture akshaysrin  ·  3Comments