Flat text inside a 3d world scene [newbie]

  • Follow


Hi,

I want to write text, just 2d-, flat text, inside a 3d world scene. Imagine some
writings on a wall, or on a billboard, in the scene. I figure I'm going to use
FTGL, but I don't need 3d text, extruded, or whatever. It's just that the 2d
text on a flat (or cylindrical surface, like wrapped around a lampost for
instance) is seen in perspective, so I guess it needs to be rotated, scaled,
etc.

As I am a total newbie in this, I wonder if someone could point me to an example
of this kind of thing, a demo or sample that would help me find my way through
all the available API's. Right now I'm trying to get the demo that comes with
FTGL to work (not straightforward).

Thx,
Joao


-- 
Joao Moreira de Sa Coutinho
joao@teaser.fr
0
Reply joao 5/18/2008 8:52:01 PM

On May 18, 10:52 pm, joao <j...@teaser.fr> wrote:
> Hi,
>
> I want to write text, just 2d-, flat text, inside a 3d world scene.
>

Make a texture with the text in it...apply the texture
to the object.


--
<\___/>
/ O O \
\_____/  FTB.     Remove my socks for email address.


0
Reply fungus 5/18/2008 9:59:26 PM


On May 18, 3:52=A0pm, joao <j...@teaser.fr> wrote:

> I want to write text, just 2d-, flat text, inside a 3d world scene. Imagin=
e some
> writings on a wall, or on a billboard, in the scene. I figure I'm going to=
 use
> FTGL, but I don't need 3d text, extruded, or whatever. It's just that the =
2d
> text on a flat (or cylindrical surface, like wrapped around a lampost for
> instance) is seen in perspective, so I guess it needs to be rotated, scale=
d,
> etc.

I use FTGL, but I don't think it supports wrapping text as you
describe.  It is easy to use:

  #include <FTGL/FTGLTextureFont.h>
  FTGLTextureFont *font;
  font =3D new FTGLTextureFont("arial.ttf");
  font->FaceSize(12);
  glEnable(GL_TEXTURE_2D);
  font->Render("my text");
  glDisable(GL_TEXTURE_2D);

Maybe you could do wrapping with FTGL using some weird modelview
transformation?  Or, you could draw the letters one at a time with
increasingly rotated transforms.  fungus' FTGLless idea is much better
and easy if you have static text.

- Chris
0
Reply crjjrc 5/19/2008 12:36:32 PM

2 Replies
172 Views

(page loaded in 0.047 seconds)

Similiar Articles:











7/30/2012 10:56:47 AM


Reply: