Re: Re: rendering fonts with OpenGL

Glynn Clements <[email protected]>
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <[email protected]>
Sebastian Sylvan wrote:

> > So if performance does matter you recommend avoiding framebuffer
> > operations in general? I am thinking about how to display a clickable UI
> > in front of a 3D scene and, naively, I would have drawn pixmaps on top
> > of the scene using the framebuffer. If I try to do the same using texture
> > mapped polygons, what is the best setup/projection to make it look like
> > a flat window like UI? How to avoid perspective and blurring effects?
> 
> Use orthogonal projection with the same width and height as your
> resolution (to make it easier to target a specific position in
> pixel-units) and make sure you draw your polygons so they're the exact
> size of the bitmap of the texture. Remember that in OpenGL (x,y)=(0,0)
> is situated at your lower left and not your upper left (as in, for
> example, windows GDI).

You can set up the projection matrix so that the origin is in the
top-left. However, this will result in a negative determinant, so
polygons will be "inside-out" (e.g. the front/back-facing test will be
inverted).

-- 
Glynn Clements <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.