Is it possible to make 3D alphabet letters in PlayCanvas with code? If it is possible, can you please share with me how to do it.
Personally, I’ve always just created text geometry in 3DS Max or Maya and imported it into PlayCanvas as FBX. However, this clearly isn’t a great solution for generalized, potentially dynamic text (say for player names in a game).
It certainly is possible, but I don’t know of anyone who’s done it in PlayCanvas yet. Essentially, the steps are:
- Convert a font (probably TTF format) to font outlines.
- Tessellate the outlines into triangles.
- Extrude the triangulated characters into 3 dimensions.
I think this tool generates the font outlines from a TTF font:
Essentially, a whole bunch of mesh processing needs to be done. It’s not trivial but it’s do-able. I’d love to see someone tackle this - it’d be cool!
Thanks for the advice!
I need some text labels over objects in my scene (about 5 of them).
If you’d compare the two options of:
- Creating 3D text in my modeling application and importing it as FBX
- Generating 2D text in canvases similar to what you did here: https://playcanvas.com/project/362231/overview/tutorial-canvas-text
Which one would you choose? 2 is obviously more flexible but which one is better in terms of performance?
If you need just 5 labels, then it is trivial over which option to choose, either geometry or texture based text.
Texture based text is “cheaper” if there are a lot of letters, it is just blended texture, where with geometry each letter will add up to triangle count.
And using texture is more flexible, as using canvas2d allows you to change and update text easily.
I’ve updated the ‘Canvas Text’ project to the current scripting system for you.
Amazing! That’s blazingly fast customer support!