Page 1 of 1

how to use CEGUI (0.5)FONT TEXTURE render 3d effect?

Posted: Mon Aug 21, 2006 15:18
by skydog
use cegui create font (freetype or pixel )

how to easy use font texture map to make 3d render effects??

font class not direct read image map data...

thanks...

Posted: Wed Aug 23, 2006 08:55
by Turtle
Hi skydog,

Do you want to be able to use a texture that contains a set of characters like, say this?:

Image

To do this you need to define:
    - your image (a square, power of 2 length and sides)
    - an .imageset file that defines the location of each character
    - a .font file that defines which .imageset file to use, and which maps images within the .imageset file to "codepoints" (characters)
    - finally, you put a reference to your new .font file into your .scheme file

I personally use Gimp to create my fonts with along with a (very rough) program I wrote that converts a line of character images into the square texture you see above.

If this is what you're trying to do, I can give you example files that I've generated, you can even have my dodgey program :)

It seems like a lot of effort, but it gets easy quite fast - it only takes me about 15 minutes to create a new font.

Or are you trying to create a font that uses a dynamic texture?

Cheers.

Posted: Tue Aug 29, 2006 02:38
by skydog
not create font problem !
is use the same font texture map
use CEGUI font texture map in 3d world or other effect...

Posted: Tue Sep 05, 2006 08:36
by Turtle
Hi skydog,

So did you want to use a CEGUI font within your 3d scene? If that's the case, it's dependent on the 3d engine you're using.

It can be done in Ogre - you can use the same font texture to write text in the 3d scene, although you'll need to use an Ogre font definition file to kind of detail similar information that is contained in the CEGUI .imageset file.

Cheers.

Posted: Tue Nov 14, 2006 17:17
by silenttree
Turtle wrote:Hi skydog,

So did you want to use a CEGUI font within your 3d scene? If that's the case, it's dependent on the 3d engine you're using.

It can be done in Ogre - you can use the same font texture to write text in the 3d scene, although you'll need to use an Ogre font definition file to kind of detail similar information that is contained in the CEGUI .imageset file.

Cheers.


i have same problem. Turtle, how can i display a CEGUI font within my 3d scene?

is there any example?

Posted: Fri Nov 24, 2006 21:39
by Turtle
Hi silenttree,

Sorry for the delay - I haven't been on the Internet much of late.

I personally use MoveableText from the Ogre Wiki:
http://www.ogre3d.org/wiki/index.php/MovableText

Of course, this means you'll need to give Ogre a .fontdef file so that Ogre knows how to define the font. Details of this format are found in the Ogre Manual at:
http://www.ogre3d.org/docs/manual/manual_36.html#SEC222
It's kind of a combination of the CEGUI .imageset and .font files.

I wrote my own utility for generating font files for both Ogre and CEGUI from the one source font out of an image file. You're welcome to a copy if you want it, but it's very rough.

If you didn't want to use MoveableText, I guess you could project your 3d coord back into your screens space and put your CEGUI text at that point. This would work well except (1) the text would appear on top of all your scene (but this could be a good thing) and (2) the font would always be the same size - it wouldn't scale with distance (which could also be a good thing).

I use MoveableText to place labels over objects in my program and it works well for me in this situation. The only problem is that it doesn't support the CEGUI feature of a "HorzAdvance", so each character is rendered at the width of the image.

Cheers.