Jump to content

[1.7.10] [SOLVED] Model Scaling Issues


Whyneb360

Recommended Posts

So my problem is that I made a model in Techne, and scaled it down to 0.7 on the x, y, and z. I've put many other models into the game, and they work perfectly, but when I tried to use GL11.glscalef(0.7F, 0.7F, 0.7F) it scaled the model down, but completely messed up the way you see it in the world. It's a bit hard to explain, but it was no longer a static block that you placed and it stayed there. It could be seen through blocks, and as you walk around it it moves all over the place. As you walk, it has the same weird bobbing effect.

 

This is my code for the render class:

public class RenderLaptop extends TileEntitySpecialRenderer {

private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/LaptopTexture.png");

private ModelLaptop model;

public RenderLaptop() {
	this.model = new ModelLaptop();
}	

@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
	World world = tileEntity.getWorldObj();
	int dir = world.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);

	GL11.glPushMatrix();

                GL11.glScafef(0.7F, 0.7F, 0.7F);

	GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
	GL11.glRotatef(180, 0F, 0F, 1F);
	GL11.glRotatef(dir * (90F), 0F, 1F, 0F);

	this.bindTexture(texture);

	this.model.renderModel(0.0625F);

	GL11.glPopMatrix();
}
}

 

Any help would be greatly appreciated

Link to comment
Share on other sites

You need to scale it after translation, or you'll scale the translation as well.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

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.