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:
https://gero3.github.io/facetype.js/
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!
Hi Will
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
or
- 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?
Regards
- Björn
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!