how to display the coordinates of a point in a scene??


iam writing aprogram for which i have a line and when i mouse click ona certain point i want the coordinates of that point to be displayed at that position itself in the scene. how to do it??

any code would be highly useful??

iam using Java and GL4java as the opengl binding for java.

thankx in advance…


Your question is a little cloudy to me. However,
I can see at least 3 possibilities.

  1. Project your 3D point onto the screen using gluProject (or your own creation), and draw your text at the resulting position on the screen.

  2. Same as one, but draw 3D text instead.

  3. Draw your 2D text in the world using a sprite–either as individual quads or a single billboard.

  4. Draw your 3D text in the world using polygons.

Woops, that was 4.