I’d need to access the screen coordinates of a 3d point after the MODELVIEW and PROJECTION transformations… is it possible?
My problem is that I have several text strings to display and they ar attached to 3d points, I am using font bitmaps.
The problem is that different text strings are often justapposed so I’d like to compute a bounding box for each string to avoid the annoying justaposition… any suggestion?
To speed up and avoid data transfer to the graphic card memory at every frame I used a Display List where I call glRasterPos3d to attach every text string to its 3D point and then glCallLists to call the nested Display Lists for the bitmap fonts.
Then the MODELVIEW matrix can change but the Display List stays unchanged.
When I call the Display List I should be able to call gluProject to see where the text strings are going on the screen, compute the bounding box, and in case they overlap, move some of them in order to avoid the justapposition.
Yet this seems incompatible with Display Lists… or I am wrong?
If you’re using nested display lists for individual strings, you can call gluProject and gluUnproject just fine outside of them, but you’re not going to be able to use them inside another display list since the display list basically ignores the call. If you’re moving stuff around dynamically anyway, a display won’t help either way since you’re changing it.