Re: opengl text balloon

Kent Quirk <[email protected]> Sun, 13 Nov 2005 17:57:24 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
OpenGL is particularly good at drawing filled polygons. Use it.

Assuming you know how to draw text, I'd do an orthographic projection 
for a bubble background layer. Create a corner piece of 2D art that 
never changes size, a vertical edge you can stretch vertically, a 
horizontal edge you can stretch horizontally, and a center background 
piece. Appropriate reflections will allow you to lay out 9 pieces in a 
rounded rectangle of arbitrary size. Figure out how big your text is and 
build the rectangle just big enough to hold it. Draw the text after you 
draw the bubble (or draw it closer in space).

Create one more (fixed-size) piece which is the "tail" of your text 
balloon and place it along the appropriate edge, reflecting as necessary 
to point it in the right direction..

    Kent

Bram Biesbrouck wrote:

>Hello,
>
>Can somebody give me some pointers on the best way to draw a resizable 2D 
>(perhaps 3D, don't know yet) text balloon in opengl? Do I use bezier curves, 
>nurbs or something else?
>
>Maybe an interesting tutorial?
>
>thanks in advance
>
>Bram
>----- 
>FAQ and OpenGL Resources at:
>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>
>  
>

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: Kent Quirk
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).