will0376
Токсичная личность
- 2,077
- 55
- 585
Рендерю внутри модели блоки/айтемы. возник вопрос: как их блин поворачивать вокруг СВОЕЙ оси?
попытался добавить стороны своему блоку - не помогло. всё,что там лежит - рендерится в 1 сторону =\
хотел вручную крутить их (2-5), но получается достаточно хреново.
Подскажет кто что?
попытался добавить стороны своему блоку - не помогло. всё,что там лежит - рендерится в 1 сторону =\
хотел вручную крутить их (2-5), но получается достаточно хреново.
Подскажет кто что?
Java:
public class RenderInsideEx extends TileEntitySpecialRenderer<TestContainerTileEntity> {
Minecraft mc = Minecraft.getMinecraft();
@Override
public void render(TestContainerTileEntity te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
try {
if (te instanceof TestContainerTileEntity) {
GL11.glPushMatrix();
super.render(te, x, y, z, partialTicks, destroyStage, alpha);
IBlockState blockState = te.getWorld().getBlockState(te.getPos());
ItemStack is = te.itemStackHandler.getStackInSlot(0).copy();
int face = blockState.getBlock().getMetaFromState(blockState);
if(is.getItem() instanceof ItemBlock)
GL11.glTranslated(x, y - 0.55, z);
else
GL11.glTranslated(x, y -0.2, z);
if (!is.isEmpty()) {
is.setCount(1);
ItemRenderer ir = Minecraft.getMinecraft().getItemRenderer();
/*if(face == 4) {
GL11.glRotated(90, 1, 0, 0);
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(0.2, -0.2, 0);
}
else if(face == 2){
GL11.glRotated(90, 1, 0, 0);
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(0.2, -0.2, 0);
}*/
GL11.glTranslated(0.5, 0.5, 0.5);
GL11.glScaled(2, 2, 2);
ir.renderItem(mc.player, is, ItemCameraTransforms.TransformType.GROUND);
}
GL11.glPopMatrix();
}
}catch (Exception e){e.printStackTrace();}
}
}