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..


Most helpful comment

Now, you do this with:;

All 3 comments

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

magnificent, ty.

Now, you do this with:;

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michelmoretti picture michelmoretti  ·  3Comments

Dino4674 picture Dino4674  ·  5Comments

hevali picture hevali  ·  3Comments

hjlld picture hjlld  ·  3Comments

savalin picture savalin  ·  5Comments