Display 2D font and bitmap over perspective result

  • Follow


Hi,

Im trying to display fonts and bitmaps on my opengl screen over the
final result. I mean, I want to render my 3d object and display text
over that.. like a game.

I looked into Nehe tutorial and every example who uses 2d fonts, it
uses Orthogonal view.. but  the other examples use Perspective view..
so it doesnt work when I try to combine the two examples.

How can I display over a 3D render using perspective?

Thanks
Patrick

0
Reply pboulay (11) 3/9/2005 6:27:35 PM

pboulay@hotmail.com wrote:
> Hi,
> 
> Im trying to display fonts and bitmaps on my opengl screen over the
> final result. I mean, I want to render my 3d object and display text
> over that.. like a game.
> 
> I looked into Nehe tutorial and every example who uses 2d fonts, it
> uses Orthogonal view.. but  the other examples use Perspective view..
> so it doesnt work when I try to combine the two examples.
> 
> How can I display over a 3D render using perspective?
> 
Bitmaps and bitmap fonts ignore the model-view and projection matrices 
-- they just put images into the frame buffer.

The call to RasterPos does go through the model-view and projection 
matrices to determine the screen coordinates and the 'raster position 
valid' flag.

Outline and polygon text also go through the model-view and projection 
matrices -- just like any other line and polygon objects.

Often you don't want to tie your text to the normal matrices -- in this 
case you render your scene with its matrices, then go to ortho mode and 
render the text.

--
Andy V
0
Reply Andy 3/9/2005 11:37:34 PM


Ok, so if I understand I need to draw all my 3d objects into the
perspective mode and at the end of the display function, I switch to
ortho mode and display text...

That's it?

Thanks
Patrick


Andy V wrote:
> pboulay@hotmail.com wrote:
> > Hi,
> >
> > Im trying to display fonts and bitmaps on my opengl screen over the
> > final result. I mean, I want to render my 3d object and display
text
> > over that.. like a game.
> >
> > I looked into Nehe tutorial and every example who uses 2d fonts, it
> > uses Orthogonal view.. but  the other examples use Perspective
view..
> > so it doesnt work when I try to combine the two examples.
> >
> > How can I display over a 3D render using perspective?
> >
> Bitmaps and bitmap fonts ignore the model-view and projection
matrices
> -- they just put images into the frame buffer.
>
> The call to RasterPos does go through the model-view and projection
> matrices to determine the screen coordinates and the 'raster position

> valid' flag.
>
> Outline and polygon text also go through the model-view and
projection
> matrices -- just like any other line and polygon objects.
>
> Often you don't want to tie your text to the normal matrices -- in
this
> case you render your scene with its matrices, then go to ortho mode
and 
> render the text.
> 
> --
> Andy V

0
Reply pboulay 3/10/2005 3:08:26 PM

pboulay@hotmail.com wrote:
> Ok, so if I understand I need to draw all my 3d objects into the
> perspective mode and at the end of the display function, I switch to
> ortho mode and display text...
> 
> That's it?

If that is sufficient, then yes.

--
Andy V

0
Reply Andy 3/11/2005 12:57:14 AM

Ok perfect, thanks!

Patrick

Andy V wrote:
> pboulay@hotmail.com wrote:
> > Ok, so if I understand I need to draw all my 3d objects into the
> > perspective mode and at the end of the display function, I switch
to
> > ortho mode and display text...
> >
> > That's it?
> 
> If that is sufficient, then yes.
> 
> --
> Andy V

0
Reply pboulay 3/15/2005 7:29:18 PM

Andy V wrote:
> pboulay@hotmail.com wrote:
> 
>> Hi,
>>
>> Im trying to display fonts and bitmaps on my opengl screen over the
>> final result. I mean, I want to render my 3d object and display text
>> over that.. like a game.
>>
>> I looked into Nehe tutorial and every example who uses 2d fonts, it
>> uses Orthogonal view.. but  the other examples use Perspective view..
>> so it doesnt work when I try to combine the two examples.
>>
>> How can I display over a 3D render using perspective?
>>
> Bitmaps and bitmap fonts ignore the model-view and projection matrices 
> -- they just put images into the frame buffer.
> 
> The call to RasterPos does go through the model-view and projection 
> matrices to determine the screen coordinates and the 'raster position 
> valid' flag.
> 
> Outline and polygon text also go through the model-view and projection 
> matrices -- just like any other line and polygon objects.
> 
> Often you don't want to tie your text to the normal matrices -- in this 
> case you render your scene with its matrices, then go to ortho mode and 
> render the text.
> 
> -- 
> Andy V

You should check out the ftgl library. I use it for all my font purposes 
for all my games and apps. It works really cool, you can download new 
font files to give your game a unique look. I can't remeber the exact 
web-site, but if u use google I'm sure you will find it.
0
Reply Yau 5/21/2005 1:00:57 AM

In article 
<428e8843$0$958$5a62ac22@per-qv1-newsreader-01.iinet.net.au>,
 Yau Goh Chow <yau_@hotmail.com> wrote:

>You should check out the ftgl library. I use it for all my font purposes 
>for all my games and apps. It works really cool, you can download new 
>font files to give your game a unique look. I can't remeber the exact 
>web-site, but if u use google I'm sure you will find it.

Like it would have hurt to spend a few extra seconds to Google it 
yourself before posting: 
<http://gltt.sourceforge.net/20011027_000000.html>.
0
Reply Lawrence 5/22/2005 4:52:15 AM

Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> writes:

> In article 
> <428e8843$0$958$5a62ac22@per-qv1-newsreader-01.iinet.net.au>,
>  Yau Goh Chow <yau_@hotmail.com> wrote:
> 
> >You should check out the ftgl library. I use it for all my font purposes 
> >for all my games and apps. It works really cool, you can download new 
> >font files to give your game a unique look. I can't remeber the exact 
> >web-site, but if u use google I'm sure you will find it.
> 
> Like it would have hurt to spend a few extra seconds to Google it 
> yourself before posting: 
> <http://gltt.sourceforge.net/20011027_000000.html>.

The official site for FTGL is 

   http://homepages.paradise.net.nz/henryj/code/index.html#FTGL


-Gerard
0
Reply Gerard 5/22/2005 4:32:42 PM

7 Replies
323 Views

(page loaded in 0.126 seconds)

Similiar Articles:













7/23/2012 11:49:21 AM


Reply: