Original Post
🔒 Locked
Tooltip question
Advertisement
Determining if you're hovering over the object is the trickiest part. You should be able to do it with "Picking", though. Check out nehe or the redbook - they both have examples of how to do this.
After you've done that, you can simply draw a quad with some text inside it above the object to show the tooltip.
Cheers,
--Brian
After you've done that, you can simply draw a quad with some text inside it above the object to show the tooltip.
Cheers,
--Brian
just use glOrtho()
Note the part that says "typically the matrix mode is GL_PROJECTION", you probably already know that, but then again it probably didnt hurt to reiterate :-).
so to draw in orthographic mode you want something like:
hope that helps
-Dan
Note the part that says "typically the matrix mode is GL_PROJECTION", you probably already know that, but then again it probably didnt hurt to reiterate :-).
so to draw in orthographic mode you want something like:
glMatrixMode(GL_PROJECTION);glPushMatrix();glLoadIdentity();glOrtho(0, 640, 0, 480, -1, 1);//this describes a matrix where the viewport covers a 640 x 480 rectangle//where the upper left hand corner is the point <0,0>//wheras glOrtho(0, 640, 480, 0, -1, 1);//would describle a matrix where the lower left hand corner is the point <0,0>//(note the -1, 1) this affects the depth buffer, i'll assume you know a bit about it//this means that things will be drawn from z=-1 to z=1, but since you're drawing//in 2d anyways chances are z will be 0//Drawing CodeglPopMatrix();hope that helps
-Dan
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement