MeshBuilder.CreateText

Hey team! I’m super glad to share a new feature that was just pushed to NPM and the PG: The MeshBuilder.CreateText function!

Creating A 3D Text object | Babylon.js Documentation (babylonjs.com)

In a nutshell, it is a simple feature that let you create a regular mesh out of a text and some font definition.

3D text example | Babylon.js Playground (babylonjs.com)

22 Likes

OMG!!!

Thanks a lot!!
Great contribution needed
BJS is going up :rocket: :rocket: :rocket:

ZmBPwn-360

2 Likes

Haha thanks :smiley:

That’s super cool. THANKS

1 Like

so much appreciated !!!

image
Looks like some of the special chars need some special love.

Which font is it?

Oh wait no, that should have been fixed…I’ll check why it is not

Check why # character is rendered incorrectly with TextBuilder · Issue #13907 · BabylonJS/Babylon.js (github.com)

1 Like

Fixed!

3 Likes

Thanks a million for this. You made my day. I have been struggling for a while creating 3D Text for my application. It now works like a charm. Keep up the good work !

Question: could you please confirm that the x,y,z point around which rotation applies is indeed at the center of mass of the 3D Text? Thanks.

It is! I compute the center of the bounding box for that

1 Like

Ok. There is something weird from my point of view. When creating the mesh and positioning it at 0,0,0, the center of the bounding box is clearly offset from the origin:

Am I doing something wrong?

I will let @Deltakosh comment on this one :slight_smile:

1 Like

PR is here CreateText does not align text on z by sebavan · Pull Request #14493 · BabylonJS/Babylon.js · GitHub

1 Like

some lower case letters need some special love:


image

and uppercase letters like J and Q, too:

The full mesh is aligned so it is kind of expected if you generate letter by letter

3 Likes