當前位置: 首頁>>代碼示例>>Java>>正文


Java GlStateManager.scale方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.scale方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.scale方法的具體用法?Java GlStateManager.scale怎麽用?Java GlStateManager.scale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.GlStateManager的用法示例。


在下文中一共展示了GlStateManager.scale方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:27,代碼來源:LayerHeldBlock.java

示例2: drawScreen

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792);
    GlStateManager.pushMatrix();
    GlStateManager.scale(2.0F, 2.0F, 2.0F);
    boolean flag = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled();
    String s = flag ? I18n.format("deathScreen.title.hardcore", new Object[0]) : I18n.format("deathScreen.title", new Object[0]);
    this.drawCenteredString(this.fontRendererObj, s, this.width / 2 / 2, 30, 16777215);
    GlStateManager.popMatrix();

    if (flag)
    {
        this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.hardcoreInfo", new Object[0]), this.width / 2, 144, 16777215);
    }

    this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.score", new Object[0]) + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215);
    super.drawScreen(mouseX, mouseY, partialTicks);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:GuiGameOver.java

示例3: renderMob

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Render the mob inside the mob spawner.
 */
public static void renderMob(MobSpawnerBaseLogic mobSpawnerLogic, double posX, double posY, double posZ, float partialTicks)
{
    Entity entity = mobSpawnerLogic.func_180612_a(mobSpawnerLogic.getSpawnerWorld());

    if (entity != null)
    {
        float f = 0.4375F;
        GlStateManager.translate(0.0F, 0.4F, 0.0F);
        GlStateManager.rotate((float)(mobSpawnerLogic.getPrevMobRotation() + (mobSpawnerLogic.getMobRotation() - mobSpawnerLogic.getPrevMobRotation()) * (double)partialTicks) * 10.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(-30.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.translate(0.0F, -0.4F, 0.0F);
        GlStateManager.scale(f, f, f);
        entity.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F);
        Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:TileEntityMobSpawnerRenderer.java

示例4: doRender

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.disableCull();
    float f = this.func_82400_a(entity.prevRotationYaw, entity.rotationYaw, partialTicks);
    float f1 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f2 = 0.0625F;
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.enableAlpha();
    this.bindEntityTexture(entity);
    this.skeletonHeadModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, f2);
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:23,代碼來源:RenderWitherSkull.java

示例5: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityVillager entitylivingbaseIn, float partialTickTime)
{
    float f = 0.9375F;

    if (entitylivingbaseIn.getGrowingAge() < 0)
    {
        f = (float)((double)f * 0.5D);
        this.shadowSize = 0.25F;
    }
    else
    {
        this.shadowSize = 0.5F;
    }

    GlStateManager.scale(f, f, f);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:RenderVillager.java

示例6: renderChest

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void renderChest(ChestType typeIn, float lidAngle) {
	ChestType type = typeIn;
	Calendar calendar = Calendar.getInstance();
	if (calendar.get(2) + 1 == 12 && calendar.get(5) >= 24 && calendar.get(5) <= 26 && type == ChestType.NORMAL) {
		type = ChestType.CHRISTMAS;
	}
	GlStateManager.color(1, 1, 1, 1);
	RenderUtils.bindTexture(type.getTexture());
	GlStateManager.pushMatrix();
	GlStateManager.enableRescaleNormal();
	GlStateManager.color(1, 1, 1, 1);
	GlStateManager.translate(0, 1.0, 1.0F);
	GlStateManager.scale(1.0F, -1.0F, -1.0F);
	GlStateManager.translate(0.5F, 0.5F, 0.5F);
	GlStateManager.rotate(2 * 90, 0.0F, 1.0F, 0.0F);
	GlStateManager.translate(-0.5F, -0.5F, -0.5F);
	CHEST_MODEL.chestLid.rotateAngleX = lidAngle;
	CHEST_MODEL.renderAll();
	GlStateManager.popMatrix();
}
 
開發者ID:p455w0rd,項目名稱:EndermanEvolution,代碼行數:21,代碼來源:CustomChestRenderer.java

示例7: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Sets the models various rotation angles then renders the model.
 */
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
{
    this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn);

    if (this.isChild)
    {
        float f = 2.0F;
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale);
        this.head.render(scale);
        this.bill.render(scale);
        this.chin.render(scale);
        GlStateManager.popMatrix();
        GlStateManager.pushMatrix();
        GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
        GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
        this.body.render(scale);
        this.rightLeg.render(scale);
        this.leftLeg.render(scale);
        this.rightWing.render(scale);
        this.leftWing.render(scale);
        GlStateManager.popMatrix();
    }
    else
    {
        this.head.render(scale);
        this.bill.render(scale);
        this.chin.render(scale);
        this.body.render(scale);
        this.rightLeg.render(scale);
        this.leftLeg.render(scale);
        this.rightWing.render(scale);
        this.leftWing.render(scale);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:39,代碼來源:ModelChicken.java

示例8: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(TileEntityGlassTerminal te, double x, double y, double z, float partialTick, int destroyStage, float alpha1)
{
    if(WorldPortalRenderer.renderLevel == 0)
    {
        bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        GlStateManager.pushMatrix();
        GlStateManager.disableLighting();

        GlStateManager.color(1F, 1F, 1F, 1F);

        GlStateManager.translate(x, y, z);

        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();

        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        bufferbuilder.begin(7, DefaultVertexFormats.BLOCK);
        blockrendererdispatcher.getBlockModelRenderer().renderModel(te.getWorld(), blockrendererdispatcher.getModelForState(Blocks.OBSIDIAN.getDefaultState()), Blocks.OBSIDIAN.getDefaultState(), BlockPos.ORIGIN, bufferbuilder, false);
        tessellator.draw();

        GlStateManager.pushMatrix();
        float scale = 0.25F;
        GlStateManager.translate(0.5D, 0.5D, 0.5D);
        GlStateManager.rotate(45F, te.facing.getFrontOffsetX(), te.facing.getFrontOffsetY(), te.facing.getFrontOffsetZ());
        GlStateManager.translate(-0.5D, -0.5D, -0.5D);

        GlStateManager.translate(0.375D, 0.375D, 0.375D);
        GlStateManager.translate(te.facing.getFrontOffsetX() * -0.4D, te.facing.getFrontOffsetY() * -0.4D, te.facing.getFrontOffsetZ() * -0.4D);
        GlStateManager.scale(scale, scale, scale);

        bufferbuilder.begin(7, DefaultVertexFormats.BLOCK);
        blockrendererdispatcher.getBlockModelRenderer().renderModel(te.getWorld(), blockrendererdispatcher.getModelForState(Blocks.GLASS.getDefaultState()), Blocks.GLASS.getDefaultState(), BlockPos.ORIGIN, bufferbuilder, false);
        tessellator.draw();
        GlStateManager.popMatrix();

        GlStateManager.enableLighting();
        GlStateManager.popMatrix();
    }
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:41,代碼來源:TileEntityGlassTerminalRenderer.java

示例9: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Sets the models various rotation angles then renders the model.
 */
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    GlStateManager.pushMatrix();
    GlStateManager.scale(2.0F, 2.0F, 2.0F);
    GlStateManager.translate(0.0F, -0.5F, 0.0F);

    if (this.base != null)
    {
        this.base.render(scale);
    }

    GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.8F + ageInTicks, 0.0F);
    GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
    this.glass.render(scale);
    float f = 0.875F;
    GlStateManager.scale(0.875F, 0.875F, 0.875F);
    GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
    GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
    this.glass.render(scale);
    GlStateManager.scale(0.875F, 0.875F, 0.875F);
    GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
    GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
    this.cube.render(scale);
    GlStateManager.popMatrix();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:30,代碼來源:ModelEnderCrystal.java

示例10: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityGhast entitylivingbaseIn, float partialTickTime)
{
    float f = 1.0F;
    float f1 = (8.0F + f) / 2.0F;
    float f2 = (8.0F + 1.0F / f) / 2.0F;
    GlStateManager.scale(f2, f1, f2);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:13,代碼來源:RenderGhast.java

示例11: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Allows the render to do state modifications necessary before the model is rendered.
 */
protected void preRenderCallback(EntityZombie entitylivingbaseIn, float partialTickTime)
{
    if (entitylivingbaseIn.getZombieType() == ZombieType.HUSK)
    {
        float f = 1.0625F;
        GlStateManager.scale(1.0625F, 1.0625F, 1.0625F);
    }

    super.preRenderCallback(entitylivingbaseIn, partialTickTime);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:14,代碼來源:RenderZombie.java

示例12: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityCreeper entitylivingbaseIn, float partialTickTime)
{
    float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
    float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
    f = MathHelper.clamp_float(f, 0.0F, 1.0F);
    f = f * f;
    f = f * f;
    float f2 = (1.0F + f * 0.4F) * f1;
    float f3 = (1.0F + f * 0.1F) / f1;
    GlStateManager.scale(f2, f3, f2);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:16,代碼來源:RenderCreeper.java

示例13: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
    public void render(int x, int y) {
        GlStateManager.pushMatrix();
//        double scale = getWidth() / (GuiUtils.PRESSURE_GAUGE_RADIUS * 2.0);
        GlStateManager.scale(SCALE, SCALE, SCALE);
        int x1 = (int)((x + getWidth() / 2) / SCALE);
        int y1 = (int)((y + getHeight() / 2) / SCALE);
        GuiUtils.drawPressureGauge(Minecraft.getMinecraft().fontRenderer, -1, crit, danger, min, pressure, x1, y1, 0, 0xFFC0C0C0);
        GlStateManager.popMatrix();
    }
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:11,代碼來源:ElementPressure.java

示例14: renderItem

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
	if (stack.isEmpty() || !(stack.getItem() instanceof ItemDankNullPanel)) {
		return;
	}

	IBakedModel model = getModel(stack);

	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.enableLighting();
	GlStateManager.enableBlend();
	GlStateManager.enableRescaleNormal();
	if (stack.isOnItemFrame()) {
		GlStateManager.scale(1.25D, 1.25D, 1.25D);
		GlStateManager.translate(-0.1D, -0.1D, -0.25D);
	}

	GlStateManager.pushMatrix();

	RenderModel.render(model, stack);
	if (stack.hasEffect()) {
		if (Options.superShine) {
			GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getMetadata(), false));
		}
		else {
			GlintEffectRenderer.apply(model, stack.getMetadata());
		}
	}

	GlStateManager.popMatrix();

	GlStateManager.disableRescaleNormal();

}
 
開發者ID:p455w0rd,項目名稱:DankNull,代碼行數:35,代碼來源:DankNullPanelRenderer.java

示例15: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Sets the models various rotation angles then renders the model.
 */
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
{
    super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
    GlStateManager.pushMatrix();

    if (this.isChild)
    {
        float f = 2.0F;
        GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
        GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
        this.standRightSide.render(scale);
        this.standLeftSide.render(scale);
        this.standWaist.render(scale);
        this.standBase.render(scale);
    }
    else
    {
        if (entityIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        this.standRightSide.render(scale);
        this.standLeftSide.render(scale);
        this.standWaist.render(scale);
        this.standBase.render(scale);
    }

    GlStateManager.popMatrix();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:34,代碼來源:ModelArmorStand.java


注:本文中的net.minecraft.client.renderer.GlStateManager.scale方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。