floating labels

How could I create flyby or floating labels for objects in my scene - so that if the mouse points this label pops up (very much like tooltips on toolbars)

cheers

IMHO, GL’s text capabilities are just too limited to make it worth the effort. It’s really quite simple to draw a white-filled box. then a black-outlined box, then drop some text into that location on the screen, all using X, or whatever windowing system you’re using.

To get it to popup, I start a timer when the mouse stops moving, and reset the timer when the mouse moves again. After X number of milliseconds have passed, I detect whatever the user has the mouse over and display the appropriate tip.

Chris

Do you have any code that I could possibly look at?

cheers

the code that I use is for Xwindows and Gtk-- : if you’de like the pseudo code for that setup, I can get you that (I can’t release the actual source sorry). Which part are you confused on… I’m not sure how Microsoft does things, but in Xwindows it’s a pretty simple matter to draw a rectangle and some text onto the screen at an arbitary location.

Chris

But can your draw rects simply over an opengl view? I always see flickering etc, so I decided to program my own window system with capability for all that stuff. Quite complex but really easy to program. Nearly as simple as GTK, well at least far better than Win32 API.

Yes any pseudo-code /code or suggestion will be fine - I’m using VC++ 6 WITH mfc (I hope that simplifies things )

[This message has been edited by fox (edited 02-23-2001).]

[This message has been edited by fox (edited 02-23-2001).]

Originally posted by Michael Steinberg:
But can your draw rects simply over an opengl view? I always see flickering etc, so

I haven’t had any problems with flickering, since for me the image is static when the tooltip is popped up - I’m sure it would flicker if I had to do buffer swaps or whatever, but my image only rotates/translates when the user grabs it with the mouse, so no tooltip displays then.

As for pseudo code, I really can’t give you anything better than the breif description above if you’re using Windows - I program for Unix/Linux, and the code isn’t very portable.

Chris