Jump to content

Recommended Posts

Posted

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();
}

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.