Posted August 8, 20178 yr for my calculations for my in-game overlay mod, i need the view projection matrix that I can translate world positions to screen positions. how can I get this matrix (those matrices)?
August 8, 20178 yr In your class: public static final FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); public static final FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); And then in your method: GlStateManager.getFloat(GL11.GL_PROJECTION_MATRIX, projection); GlStateManager.getFloat(GL11.GL_MODELVIEW_MATRIX, modelview); Matrix4f projectionMatrix = (Matrix4f) new Matrix4f().load(projection.asReadOnlyBuffer()); Matrix4f modelViewMatrix = (Matrix4f) new Matrix4f().load(modelview.asReadOnlyBuffer()); Matrix4f result = Matrix4f.mul(modelViewMatrix, projectionMatrix, null); Edited August 8, 20178 yr by Silly511
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.