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


Java GlStateManager.popMatrix方法代碼示例

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


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

示例1: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(TileSuperCharger te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    ItemStack stack = te.getInventory(EnumFacing.NORTH).getStackInSlot(0);
    if(!stack.isEmpty() && !te.getWorld().getBlockState(te.getPos().up()).isFullBlock()){
        this.setLightmapDisabled(true);
        GlStateManager.pushMatrix();
        GlStateManager.translate(x + 0.5, y + 1.0, z + 0.5);
        GlStateManager.rotate(90, 1 , 0, 0);
        GlStateManager.rotate(90, 0 , 0, 1);
        float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F;
        GlStateManager.scale(scale, scale, scale);
        if(stack.getItem() instanceof ItemBlock){
            GlStateManager.rotate(-90, 1, 0, 0);
            GlStateManager.translate(0, 0.25, 0);
        }
        Util.renderItemInWorld(stack);
        GlStateManager.popMatrix();
        this.setLightmapDisabled(false);
    }
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:21,代碼來源:RenderSuperCharger.java

示例2: renderLine

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void renderLine(int regen, boolean low, int yTexture, int maxHealth, int maxExtraHearts, int current, int absorption, Gui gui, boolean highlight) {
    GlStateManager.pushMatrix();
    Int2IntMap map = new Int2IntArrayMap();
    if (low) {
        for (int i = 0; i < (maxHealth + maxExtraHearts); i++)
            map.put(i, EventHandler.rand.nextInt(2));
    }

    renderMax(regen, map, maxHealth, yTexture, gui, highlight);
    if (maxExtraHearts > 0) { //for absorption
        if (maxHealth != 0) {
            GlStateManager.translate(2 + 9 * maxHealth, 0, 0);
        }
        renderMax(regen - maxHealth, map, maxExtraHearts, yTexture, gui, false); //Do not highlight absorption
    }
    GlStateManager.popMatrix();
    GlStateManager.translate(0, 0, 1);

    renderCurrentHealth(regen, map, current, yTexture, gui);

    if (absorption > 0) {
        int offset = maxHealth * 9 + (maxHealth == 0 ? 0 : 2);
        GlStateManager.translate(offset, 0, 0);
        renderAbsorption(regen - maxHealth, map, absorption, yTexture, gui);
    }
}
 
開發者ID:ichttt,項目名稱:FirstAid,代碼行數:27,代碼來源:GuiUtils.java

示例3: drawButton

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks)
{
	if (this.visible)
	{
		int x = this.x + this.parentGui.getGuiLeft();
		FontRenderer fontrenderer = mc.fontRenderer;
		int k = this.getHoverState(this.hovered);
		mc.getTextureManager().bindTexture(GuiPlayerInventoryExtended.background);
		GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
		this.hovered = mouseX >= x && mouseY >= this.y && mouseX < x + this.width && mouseY < this.y + this.height;
		GlStateManager.enableBlend();
		GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
		GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
		GlStateManager.pushMatrix();
		GlStateManager.translate(0, 0, 200);
		HarshenClientUtils.drawTexture(x, this.y, 16.9f, (k  - 1) * 7f, 7f, 7f,  24, 24, 24, 24);
		if (k!=1)
			this.drawCenteredString(fontrenderer, I18n.translateToLocalFormatted(this.displayString), x + 5, this.y + this.height, 0xffffff);
		GlStateManager.popMatrix();

		this.mouseDragged(mc, mouseX, mouseY);
	}
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:25,代碼來源:GuiHarshenButton.java

示例4: drawEnchantTag

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void drawEnchantTag(final String text, int x, int y) {
    GlStateManager.pushMatrix();
    GlStateManager.disableDepth();
    x *= (int)1.75;
    y -= 4;
    GL11.glScalef(0.57f, 0.57f, 0.57f);
    Client.font.drawStringWithShadow(text, x, -36 - y, -1286);
    GlStateManager.enableDepth();
    GlStateManager.popMatrix();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:11,代碼來源:Tags.java

示例5: renderTile

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
void renderTile(TileQuantumMirror mirror, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
	float tick = RenderHelper.getRenderWorldTime(partialTicks);
	int layer = MinecraftForgeClient.getRenderPass();

	final float prevU = OpenGlHelper.lastBrightnessX;
	final float prevV = OpenGlHelper.lastBrightnessY;
	switch(layer) {
		case 0:
			Optional<UUID> optional = mirror.getKey();
			if(optional.isPresent()) {
				ItemStack stack = QuantumHandler.getEntanglementStack(optional.get(), 0);
				if(stack.isEmpty()) break;

				GlStateManager.pushMatrix();
				GLHelper.lightMap(255F, 255F);
				GlStateManager.translate(x + 0.5, y + 0.38, z + 0.5);

				GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
				RenderHelper.renderItemStack(stack);

				GlStateManager.popMatrix();
			}
			break;
		case 1:
			renderModel(tick, x, y, z);
			break;
	}
	GLHelper.lightMap(prevU, prevV);
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:31,代碼來源:QuantumMirrorRenderer.java

示例6: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(TileEntityXPBlock te, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
{
	if(GlobalXP.config.renderNameplate)
	{
		ITextComponent levelsText = new TextComponentString((int)te.getStoredLevels() + " (" + te.getStoredXP() + ")");

		if(te != null && te.getPos() != null && rendererDispatcher.cameraHitResult != null && rendererDispatcher.cameraHitResult.getBlockPos() != null && rendererDispatcher.cameraHitResult.getBlockPos().equals(te.getPos()))
		{
			setLightmapDisabled(true);
			drawNameplate(te, levelsText.getFormattedText(), x, y, z, 12);
			setLightmapDisabled(false);
		}
	}

	double offset = Math.sin((te.getWorld().getTotalWorldTime() + partialTicks) * GlobalXP.config.bobSpeed / 8.0D) / 10.0D;
	IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(emerald, te.getWorld(), null);

	GlStateManager.enableRescaleNormal();
	GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
	GlStateManager.enableBlend();
	RenderHelper.enableStandardItemLighting();
	GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
	GlStateManager.pushMatrix();
	GlStateManager.translate(x + 0.5D, y + 0.4D + offset, z + 0.5D);
	GlStateManager.rotate((te.getWorld().getTotalWorldTime() + partialTicks) * 4.0F * (float)GlobalXP.config.spinSpeed, 0.0F, 1.0F, 0.0F);
	model = ForgeHooksClient.handleCameraTransforms(model, TransformType.GROUND, false);
	Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
	Minecraft.getMinecraft().getRenderItem().renderItem(emerald, model);
	GlStateManager.popMatrix();
	GlStateManager.disableRescaleNormal();
	GlStateManager.disableBlend();
}
 
開發者ID:bl4ckscor3,項目名稱:GlobalXP,代碼行數:34,代碼來源:TileEntityXPBlockRenderer.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 limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);

    if (this.isChild)
    {
        float f = 2.0F;
        this.childYOffset = 16.0F;
        this.childZOffset = 4.0F;
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.6666667F, 0.6666667F, 0.6666667F);
        GlStateManager.translate(0.0F, this.childYOffset * scale, this.childZOffset * scale);
        this.head.render(scale);
        GlStateManager.popMatrix();
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.5F, 0.5F, 0.5F);
        GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
        this.body.render(scale);
        this.leg1.render(scale);
        this.leg2.render(scale);
        this.leg3.render(scale);
        this.leg4.render(scale);
        GlStateManager.popMatrix();
    }
    else
    {
        this.head.render(scale);
        this.body.render(scale);
        this.leg1.render(scale);
        this.leg2.render(scale);
        this.leg3.render(scale);
        this.leg4.render(scale);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:38,代碼來源:ModelPolarBear.java

示例8: boundingBox

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void boundingBox(Entity entity, double x, double y, double z, int color, int colorIn) {
    GlStateManager.pushMatrix();
    GL11.glLineWidth((float)1.0f);
    AxisAlignedBB var11 = entity.getEntityBoundingBox();
    AxisAlignedBB var12 = new AxisAlignedBB(var11.minX - entity.posX + x, var11.minY - entity.posY + y, var11.minZ - entity.posZ + z, var11.maxX - entity.posX + x, var11.maxY - entity.posY + y, var11.maxZ - entity.posZ + z);
    if (color != 0) {
        GlStateManager.disableDepth();
        RenderUtils.filledBox(var12, colorIn, true);
        RenderUtils.disableLighting();
        drawOutlinedBoundingBox((AxisAlignedBB)var12, (int)color);
    }
    GlStateManager.popMatrix();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:14,代碼來源:RenderUtils.java

示例9: renderDebugInfo

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void renderDebugInfo(ScaledResolution scaledResolutionIn)
{
    this.mc.mcProfiler.startSection("debug");
    GlStateManager.pushMatrix();
    this.renderDebugInfoLeft();
    this.renderDebugInfoRight(scaledResolutionIn);
    GlStateManager.popMatrix();
    this.mc.mcProfiler.endSection();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:GuiOverlayDebug.java

示例10: doRender

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) {
	GlStateManager.pushMatrix();
	GlStateManager.translate((float) x, (float) y, (float) z);
	GlStateManager.enableRescaleNormal();
	GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(
			(float) (this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * this.renderManager.playerViewX,
			1.0F, 0.0F, 0.0F);
	GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
	this.bindTexture(getEntityTexture(entity));

	if (this.renderOutlines) {
		GlStateManager.enableColorMaterial();
		GlStateManager.enableOutlineMode(this.getTeamColor(entity));
	}

	this.itemRenderer.renderItem(this.getStackToRender(entity), ItemCameraTransforms.TransformType.GROUND);

	if (this.renderOutlines) {
		GlStateManager.disableOutlineMode();
		GlStateManager.disableColorMaterial();
	}

	GlStateManager.disableRescaleNormal();
	GlStateManager.popMatrix();
	super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:28,代碼來源:RenderProjectileItem.java

示例11: renderItem

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderItem(TilePedestal te) {
    ItemStack stack = te.getStack();
    if (stack != null) {
        RenderHelper.enableStandardItemLighting();
        GlStateManager.enableLighting();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.5, 0.75, 0.5);
        GlStateManager.scale(0.4F, .4F, 0.4F);

        Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);

        GlStateManager.popMatrix();
    }
}
 
開發者ID:the-realest-stu,項目名稱:Infernum,代碼行數:15,代碼來源:TESRPedestal.java

示例12: renderEffect

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderEffect(IBakedModel model)
{
    GlStateManager.depthMask(false);
    GlStateManager.depthFunc(514);
    GlStateManager.disableLighting();
    GlStateManager.blendFunc(768, 1);
    this.textureManager.bindTexture(RES_ITEM_GLINT);
    GlStateManager.matrixMode(5890);
    GlStateManager.pushMatrix();
    GlStateManager.scale(8.0F, 8.0F, 8.0F);
    float f = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F;
    GlStateManager.translate(f, 0.0F, 0.0F);
    GlStateManager.rotate(-50.0F, 0.0F, 0.0F, 1.0F);
    this.renderModel(model, -8372020);
    GlStateManager.popMatrix();
    GlStateManager.pushMatrix();
    GlStateManager.scale(8.0F, 8.0F, 8.0F);
    float f1 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F;
    GlStateManager.translate(-f1, 0.0F, 0.0F);
    GlStateManager.rotate(10.0F, 0.0F, 0.0F, 1.0F);
    this.renderModel(model, -8372020);
    GlStateManager.popMatrix();
    GlStateManager.matrixMode(5888);
    GlStateManager.blendFunc(770, 771);
    GlStateManager.enableLighting();
    GlStateManager.depthFunc(515);
    GlStateManager.depthMask(true);
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:30,代碼來源:RenderItem.java

示例13: draw

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public void draw(int x, int y)
{
    x += 3;
    y += 3;
    GlStateManager.pushMatrix();
    GlStateManager.translate(0, 0, 500);
    GlStateManager.enableBlend();
    GuiDrawableRegistry.displayMessage.draw(OverlayGui.INSTANCE, 0, 0);
    GlStateManager.disableBlend();
    DrawingTools.drawString(formatSting(getSubject()), x, y, Colors.YELLOW_500);
    DrawingTools.drawString(formatSting(getDescription()), x + 5, y + 11, Colors.WHITE);
    GlStateManager.popMatrix();
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:15,代碼來源:DisplayMessage.java

示例14: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        RenderHelper.disableStandardItemLighting();
        float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
        float f1 = 0.0F;

        if (f > 0.8F)
        {
            f1 = (f - 0.8F) / 0.2F;
        }

        Random random = new Random(432L);
        GlStateManager.disableTexture2D();
        GlStateManager.shadeModel(7425);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
        GlStateManager.disableAlpha();
        GlStateManager.enableCull();
        GlStateManager.depthMask(false);
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, -1.0F, -2.0F);

        for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
        {
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
            float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
            float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
            vertexbuffer.begin(6, DefaultVertexFormats.POSITION_COLOR);
            vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
            vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            vertexbuffer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            vertexbuffer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
            vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            tessellator.draw();
        }

        GlStateManager.popMatrix();
        GlStateManager.depthMask(true);
        GlStateManager.disableCull();
        GlStateManager.disableBlend();
        GlStateManager.shadeModel(7424);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        GlStateManager.enableAlpha();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:57,代碼來源:LayerEnderDragonDeath.java

示例15: doRender

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityEnderCrystal entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    float f = (float)entity.innerRotation + partialTicks;
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    this.bindTexture(ENDER_CRYSTAL_TEXTURES);
    float f1 = MathHelper.sin(f * 0.2F) / 2.0F + 0.5F;
    f1 = f1 * f1 + f1;

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    if (entity.shouldShowBottom())
    {
        this.modelEnderCrystal.render(entity, 0.0F, f * 3.0F, f1 * 0.2F, 0.0F, 0.0F, 0.0625F);
    }
    else
    {
        this.modelEnderCrystalNoBase.render(entity, 0.0F, f * 3.0F, f1 * 0.2F, 0.0F, 0.0F, 0.0625F);
    }

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    BlockPos blockpos = entity.getBeamTarget();

    if (blockpos != null)
    {
        this.bindTexture(RenderDragon.ENDERCRYSTAL_BEAM_TEXTURES);
        float f2 = (float)blockpos.getX() + 0.5F;
        float f3 = (float)blockpos.getY() + 0.5F;
        float f4 = (float)blockpos.getZ() + 0.5F;
        double d0 = (double)f2 - entity.posX;
        double d1 = (double)f3 - entity.posY;
        double d2 = (double)f4 - entity.posZ;
        RenderDragon.renderCrystalBeams(x + d0, y - 0.3D + (double)(f1 * 0.4F) + d1, z + d2, partialTicks, (double)f2, (double)f3, (double)f4, entity.innerRotation, entity.posX, entity.posY, entity.posZ);
    }

    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:51,代碼來源:RenderEnderCrystal.java


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