本文整理汇总了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();
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}