Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set TextGeometry pivot point #1407

Closed
zsitro opened this issue Feb 27, 2012 · 3 comments
Closed

set TextGeometry pivot point #1407

zsitro opened this issue Feb 27, 2012 · 3 comments
Labels

Comments

@zsitro
Copy link

zsitro commented Feb 27, 2012

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

@ColasMarko
Copy link
Contributor

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

@zsitro
Copy link
Author

zsitro commented Feb 27, 2012

magnificent, ty.

@zsitro zsitro closed this as completed Feb 27, 2012
@that-ben
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants