Posted December 17, 201410 yr I want to use multiple vanilla textures in my tesr, but how am i supposed to get the uv of a certain texture on the texture map?
December 17, 201410 yr Author So, i tried to have a 14*14 face, but it uses the full texture, not the center 14*14 pixels as intendet. P.S.: wp is 1d/16d @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) { this.bindTexture(TextureMap.locationBlocksTexture); IIcon woodOak = Blocks.planks.getIcon(0, 0); IIcon woodEbony = GameRegistry.findBlock("derpyshiz", "plank").getIcon(0, 0); double bodyMinU = ((woodEbony.getMaxU()-woodEbony.getMaxU())*wp)+woodEbony.getMinU(); double bodyMaxU = woodEbony.getMaxU()-((woodEbony.getMaxU()-woodEbony.getMaxU())*wp); double bodyMinV = ((woodEbony.getMaxV()-woodEbony.getMaxV())*wp)+woodEbony.getMinV(); double bodyMaxV = woodEbony.getMaxV()-((woodEbony.getMaxV()-woodEbony.getMaxV())*wp); Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix(); GL11.glTranslated(x, y, z); tessellator.startDrawingQuads(); //front body tessellator.addVertexWithUV(1-wp, wp, wp, bodyMinU, bodyMaxV); tessellator.addVertexWithUV(wp, wp, wp, bodyMaxU, bodyMaxV); tessellator.addVertexWithUV(wp, 1-wp, wp, bodyMaxU, bodyMinV); tessellator.addVertexWithUV(1-wp, 1-wp, wp, bodyMinU, bodyMinV); tessellator.draw(); GL11.glPopMatrix(); }
December 17, 201410 yr I don't know if this would help but ((woodEbony.getMaxU()-woodEbony.getMaxU())*wp)+woodEbony.getMinU() would just equal woodEbony.getMinU() . You are getting the maxU minus the maxU, which just equals 0 and has no purpose. When its multiplied, its still 0. Same goes for the other 3 UVs
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.