Jump to content

3D font in babylon.js


Alex10
 Share

Recommended Posts

Very nice  :)

 

I'm still thinking about another approach (than precomputing some fonts + alphabets).

When you download, say, a google font, you get a woff file.

This file should embbed a trueType, or openType set of data describing the font : vectors, curves, etc. Maybe SVG... I don't know the format.

I just know it should readable and probably transposable in 2D coordinates, vectors, curves as we use in BJS.

 

So if we could dynamically translate a web font into a 2D shape and then extrude it (this part is already done), we could then use all fonts the browser is able to render in HTML text for 3D.

 

Just a dream :rolleyes:  

Link to comment
Share on other sites

With dynamic mesh simplification based-on distance to view.  Yum.

 

(probably only accomplished by pre-rendering some LOD versions of the characters used in the text scroller)

 

Yep, Alex10, we are both waiting to try flying mesh-words.  :)  That's when we can REALLY start using BJS for blatant advertising.

 

Yay!  errrr... no... BOO!... err... something.  :)  "Waitress... how's the Woff today?  I'll have a double order!"

 

And, of course, for flying text... we'll need paths... and Jerome is Captain Pathematics.  :)

Link to comment
Share on other sites

  • 1 month later...

There is always a way, but you will have to use Blender to build a font.  The .blend in the repository, fontGen.blend, https://github.com/BabylonJS/Extensions/tree/master/Dialog/fonts, can generate meshes of any typeface you can assign it.  I do not have any fonts files on Ubuntu (or know where they are anyway).  In Windows, you might find them.  Click the highlighted button from this picture, and open the font file.

post-8492-0-83551000-1431895743_thumb.pn

You might want to just build signs that you can export to a .babylon file, instead.  Do that by:

  • Select the 'A' in the scene  (right click).  It is not actually a mesh object.  Runing the script on the left (Alt-P) builds the meshes.
  • Go into edit mode by typing 'tab' (with mouse still in scene area), or change the dropdown in the bottom middle that says Object Mode in the picture.
  • keyboard will now change the 'A' into whatever sign you wish to make, including multi-line
  • Click in the script, and drop the extrude down to about 0.1
  • Type Alt-P to generate your mesh.

You can repeat for multiple signs.  They will all write at the orign & look like a mess, but they can be moved here or once imported to Babylon.  I made 2 here.  You probably want to rename them if you make a multi line, cause the name of the mesh is the same as the text.

post-8492-0-11332400-1431896940.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...