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

yqrashawn picture yqrashawn  路  3Comments

akshaysrin picture akshaysrin  路  3Comments

konijn picture konijn  路  3Comments

boyravikumar picture boyravikumar  路  3Comments

danieljack picture danieljack  路  3Comments