I am wondering how exactly I can convert a location (XYZ) to a point on the screen (XY).
I have a player (the player you control) that is in coordinates (XYZ), and another player who is also in coordinates (XYZ).
How exactly can I convert another XYZ player to XY on the screen so that I can draw a name over it / this with X Y.
Hope this makes sense ...
Edit:
Here is my gluProject code:
IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); FloatBuffer objectCoords = GLAllocation.createDirectFloatBuffer(3); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection); GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); GLU.gluProject(x, y, z, modelview, projection, viewport, objectCoords); eturn objectCoords;
Thanks.
math 3d location point
Timothy Hanes
source share