Re: Keeping an object's label on the screen

"Monteleone, Nathan" <[email protected]>
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
The hard part is figuring out the screen area I want to allow it to live
in - the overlay in question is rendered to a texture and then pasted on
the terrain.

I think I know how to do it though - I know the 2d bound of my overlay.
I can combine that with the min/max height of the terrain underneath to
get a pretty good bounding box, then project that to screen space like
Mr. Watte said.

-Nathan


-----Original Message-----
From: Tom Plunket [mailto:[email protected]] 
Sent: Sunday, May 03, 2009 8:26 PM
To: Game Development Algorithms
Subject: Re: [Algorithms] Keeping an object's label on the screen


> I have to draw some billboard text over some shapes we've "painted"
onto
> our terrain via multitexturing.  Normally this is easy enough - just
> plop the label in an auto-rotated billboard and float it above the
> center of the geometry.  But I need to keep the label on screen at all
> times if any part of the painted geometry is visible.  I.e. if I have
a
> square painted on the terrain, but I can only see a small corner of
it,
> I still need to show the whole label.

Draw the text if the object isn't culled.

You know where you want the text drawn (if you were to draw onto the
center of the object), and if you've got the text rect you can just move
it so it's within the screen area you want to allow it to live in.

-tom!

-- 



------------------------------------------------------------------------
------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-lis
t

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
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.