3D fonts, building the meshes
category: general [glöplog]
Hello all, this has been on my mind for some time now, how do you generate a mesh for a character in a font.
I just saw the Horde2007 invitation and it must have been generated at run-time since it's 4k. And it looks really nice too.
The only way I've done it was by generating a cylinder along a spline.
Thanks
I just saw the Horde2007 invitation and it must have been generated at run-time since it's 4k. And it looks really nice too.
The only way I've done it was by generating a cylinder along a spline.
Thanks
Check CreateFont() and wglUseFontOutlines()
(there are probably better ways to do that though, I dont use system fonts in our 64k intros but prevectorized fonts)
OpenGL (at least in windows) has a function that does it for you (wglUseFontOutlines)... there's probably equivalent functions in other OSes with GL, and probably with DirectX too
oops, keops was faster :)
Or if you're using d3d, you could always do GetGlyphOutline and use gluTess (yeah, gluTess works without a GL-context) and construct the mesh from that.
Here's a very old and rather chunky code that makes use of it: http://jcl.scenesp.org/files/code/Font3D.cs ( and the interface: http://jcl.scenesp.org/files/code/IFont.cs )...
... it's C# and my very begginings with it (i'd probably do things quite differently now :) ) but the usage in OpenGL is quite clear there
... it's C# and my very begginings with it (i'd probably do things quite differently now :) ) but the usage in OpenGL is quite clear there
That code in action (one of the very first tests of it):
Why do you have an icon of Mario on the Load Mesh button?
I have no clue, sincerely... thing is, it eventually dissapeared from the application... this is the last snap I did of that application, and it had gone away:
and what is this program supposed to do exactly ? is it a demo maker ?
it originally was a material editor (as the caption says)... it evolved to somehow a "flyby scene editor", but far from being a demomaker (and was not used for that... it was part of my VJ thinggie).
I stopped its development some years ago though (I don't do VJ stuff anymore)
Some more snapshots here: http://jcl.scenesp.org/files/meditorsnaps/. From bottom to top, you can kinda see the evolution (at least till I stopped making screenshots :) )
I stopped its development some years ago though (I don't do VJ stuff anymore)
Some more snapshots here: http://jcl.scenesp.org/files/meditorsnaps/. From bottom to top, you can kinda see the evolution (at least till I stopped making screenshots :) )
thanks for the help