public static void drawPlayerOnGui( Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5) { GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glPushMatrix(); GL11.glTranslatef((float) par1, (float) par2, 50.0F); GL11.glScalef((float) (-par3), (float) par3, (float) par3); GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); float f2 = par0Minecraft.thePlayer.renderYawOffset; float f3 = par0Minecraft.thePlayer.rotationYaw; float f4 = par0Minecraft.thePlayer.rotationPitch; par4 -= 19; GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); RenderHelper.enableStandardItemLighting(); GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-((float) Math.atan((double) (par5 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); par0Minecraft.thePlayer.renderYawOffset = (float) Math.atan((double) (par4 / 40.0F)) * 20.0F; par0Minecraft.thePlayer.rotationYaw = (float) Math.atan((double) (par4 / 40.0F)) * 40.0F; par0Minecraft.thePlayer.rotationPitch = -((float) Math.atan((double) (par5 / 40.0F))) * 20.0F; par0Minecraft.thePlayer.rotationYawHead = par0Minecraft.thePlayer.rotationYaw; GL11.glTranslatef(0.0F, par0Minecraft.thePlayer.yOffset, 0.0F); RenderManager.instance.playerViewY = 180.0F; RenderManager.instance.renderEntityWithPosYaw( par0Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); par0Minecraft.thePlayer.renderYawOffset = f2; par0Minecraft.thePlayer.rotationYaw = f3; par0Minecraft.thePlayer.rotationPitch = f4; GL11.glPopMatrix(); RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); }
@Override public void postRender(float scale) { if (!this.isHidden && this.showModel) { // if(!this.compiled) { // this.compileDisplayList(scale); // } if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { GL11.glTranslatef( this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); } } else { GL11.glTranslatef( this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); if (this.rotateAngleZ != 0.0F) { GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F); } if (this.rotateAngleY != 0.0F) { GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F); } } } }
private void drawEnergyBeam(Tessellator tess, TileParticleGenerator gen, float f) { TileEnergyStorageCore master = gen.getMaster(); if (master == null) return; float length = 0; GL11.glPushMatrix(); if (master.xCoord > gen.xCoord) { GL11.glRotatef(-90F, 0F, 0F, 1F); GL11.glTranslated(-1, 0.5, 0); length = master.xCoord - gen.xCoord - 0.2F; } else if (master.xCoord < gen.xCoord) { GL11.glRotatef(90F, 0F, 0F, 1F); GL11.glTranslated(0, -0.5, 0); length = gen.xCoord - master.xCoord - 0.2F; } else if (master.zCoord > gen.zCoord) { GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glTranslated(0, 0.5, -1); length = master.zCoord - gen.zCoord - 0.2F; } else if (master.zCoord < gen.zCoord) { GL11.glRotatef(-90F, 1F, 0F, 0F); GL11.glTranslated(0, -0.5, 0); length = gen.zCoord - master.zCoord - 0.2F; } renderStabilizerSphere(gen); renderEnergyBeam(tess, gen, length, f); GL11.glPopMatrix(); }
@SubscribeEvent(priority = EventPriority.LOWEST) @Optional.Method(modid = Mods.OpenComputers) public void onRobotRender(RobotRenderEvent e) { if (!rendering) { return; } if (e.mountPoints == null || e.mountPoints.length < 2) { return; } MountPoint mountPoint = e.mountPoints[1]; GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glTranslatef(0.5f, 0.5f, 0.5f); GL11.glColor3f(color.r, color.g, color.b); float degrees = 360 - ((time % 160) / 160F * 360F); Minecraft.getMinecraft().getTextureManager().bindTexture(modelRadar); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glRotatef(180, 1, 0, 0); GL11.glRotatef( mountPoint.rotation.getW(), mountPoint.rotation.getX(), mountPoint.rotation.getY(), mountPoint.rotation.getZ()); GL11.glTranslatef(0F, -0.8F, 0F); GL11.glTranslatef(mountPoint.offset.getX(), mountPoint.offset.getY(), mountPoint.offset.getZ()); GL11.glScalef(0.3f, 0.3f, 0.3f); GL11.glPushMatrix(); radarModel.render(Math.max(degrees, 0)); GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glPopAttrib(); }
@Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); switch (tileentity.getBlockMetadata()) { case 5: GL11.glRotatef(90, 0F, 1F, 0F); break; case 3: GL11.glRotatef(180, 0F, 1F, 0F); break; case 4: GL11.glRotatef(270, 0F, 1F, 0F); break; case 2: GL11.glRotatef(0, 0F, 1F, 0F); break; } this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
/** R_PolyBlend */ void R_PolyBlend() { if (gl_polyblend.value == 0.0f) return; if (v_blend[3] == 0.0f) return; GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glLoadIdentity(); // FIXME: get rid of these GL11.glRotatef(-90, 1, 0, 0); // put Z going up GL11.glRotatef(90, 0, 0, 1); // put Z going up GL11.glColor4f(v_blend[0], v_blend[1], v_blend[2], v_blend[3]); GL11.glBegin(GL11.GL_QUADS); GL11.glVertex3f(10, 100, 100); GL11.glVertex3f(10, -100, 100); GL11.glVertex3f(10, -100, -100); GL11.glVertex3f(10, 100, -100); GL11.glEnd(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(1, 1, 1, 1); }
public void renderModelAt(TileEntitySafe safe, double d, double d1, double d2, float f) { int x; if (safe.worldObj == null) { x = 0; } else { x = ZoocraftiaDirection.getOpposite(safe.getDirection()); } GL11.glPushMatrix(); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); if (x == 1) GL11.glRotatef(-90, 0, 1F, 0); if (x == 3) GL11.glRotatef(90, 0, 1F, 0); if (x == 2) GL11.glRotatef(180, 0, 1F, 0); if (x == 0) GL11.glRotatef(0, 0, 1F, 0); GL11.glRotatef(180, 1F, 0, 0); bindTextureByName("/zoocraftia/functional/textures/safe.png"); GL11.glPushMatrix(); float rotation = safe.prevAngle + (safe.currentAngle - safe.prevAngle) * f; rotation = 1.0F - rotation; rotation = 1.0F - rotation; safeModel.SafeDoor.rotateAngleY = -(rotation * (float) Math.PI * 1.5F) / 2; safeModel.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
public void renderArrow( ProjectileConfusion proj, double par2, double par4, double par6, float par8, float par9) { this.bindEntityTexture(proj); GL11.glPushMatrix(); GL11.glTranslatef((float) par2, (float) par4, (float) par6); GL11.glRotatef( proj.prevRotationYaw + (proj.rotationYaw - proj.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef( proj.prevRotationPitch + (proj.rotationPitch - proj.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); Tessellator tessellator = Tessellator.instance; byte b0 = 0; float f2 = 0.0F; float f3 = 0.5F; float f4 = (float) (0 + b0 * 10) / 32.0F; float f5 = (float) (5 + b0 * 10) / 32.0F; float f6 = 0.0F; float f7 = 0.15625F; float f8 = (float) (5 + b0 * 10) / 32.0F; float f9 = (float) (10 + b0 * 10) / 32.0F; float f10 = 0.05625F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4.0F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8); tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8); tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9); tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8); tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8); tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9); tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9); tessellator.draw(); for (int i = 0; i < 4; ++i) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4); tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4); tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5); tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5); tessellator.draw(); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
public void doRender(Entity entity, double x, double y, double z, float f, float f1) { f = 0.0625f; RenderState.blendingOn(); int timestep = (int) ((System.currentTimeMillis()) % 10000); double angle = timestep * Math.PI / 5000.0; GL11.glPushMatrix(); GL11.glRotatef(180.0f, 1.0f, 0, 0); GL11.glTranslatef(0.5f, -1.5f, -0.5f); middletable.render(f); uppertable.render(f); footbase.render(f); foot1.render(f); fatfoot2.render(f); fatfoot1.render(f); backsupport.render(f); tank3.render(f); tank2.render(f); tank1.render(f); wireshort4.render(f); wireshort3.render(f); wireshort2.render(f); Wireshort1.render(f); Wirelong1.render(f); RenderState.glowOn(); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.5f, 1.05f, 0.5f); GL11.glTranslated(0, 0.02f * Math.sin(angle * 3), 0); // GLRotate uses degrees instead of radians for some reason grr GL11.glRotatef((float) (angle * 57.2957795131), 0.0f, 1.0f, 0.0f); GL11.glRotatef(45f, 1.0f, 0.0f, 0.0f); // arctangent of 0.5. GL11.glRotatef(35.2643897f, 0, 1, 1); // cube.render(0.0625f); GL11.glColor4d(1, 1, 1, 0.8); cube.render(f / 2.0f); // cube.render(0.016000f); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glRotatef(180.0f, 1.0f, 0, 0); GL11.glTranslatef(0.5f, -1.5f, -0.5f); screen3.render(f); screen2.render(f); screen1.render(f); particles.render(f); GL11.glPopMatrix(); // GL11.glPushMatrix(); // if (Minecraft.getMinecraft().isFancyGraphicsEnabled()) { // if (f1 != 0) { // GL11.glDisable(GL11.GL_CULL_FACE); // for (int i = 0; i < 1; i++) { // drawScanLine(angle); // } // } // } // GL11.glPopMatrix(); RenderState.glowOff(); RenderState.blendingOff(); }
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { int i; if (tileentity.getWorldObj() == null) { i = 0; } else { Block block = tileentity.getBlockType(); i = tileentity.getBlockMetadata(); if ((block != null) && (i == 0)) { i = tileentity.getBlockMetadata(); } } GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glPushMatrix(); GL11.glRotatef(180.0F, 180.0F, 0.0F, 0.0F); int j = 0; if (i == 3) { j = 0; } if (i == 2) { j = 180; } if (i == 4) { j = 90; } if (i == 5) { j = 270; } GL11.glRotatef(j, 0.0F, 1.0F, 0.0F); this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
public void renderBoat(EntityBoat entityboat, double d, double d1, double d2, float f, float f1) { GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef(180F - f, 0.0F, 1.0F, 0.0F); float f2 = (float) entityboat.func_41018_h() - f1; float f3 = (float) entityboat.func_41020_g() - f1; if (f3 < 0.0F) { f3 = 0.0F; } if (f2 > 0.0F) { GL11.glRotatef( ((MathHelper.sin(f2) * f2 * f3) / 10F) * (float) entityboat.func_41016_i(), 1.0F, 0.0F, 0.0F); } loadTexture("/terrain.png"); float f4 = 0.75F; GL11.glScalef(f4, f4, f4); GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); loadTexture("/item/boat.png"); GL11.glScalef(-1F, -1F, 1.0F); modelBoat.render(entityboat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
private void doRender( TileEntity tileEntity, double x, double y, double z, float partialTickTime) { this.bindTexture(resource); /* * 回転用の角度, tick毎に更新される. * なお, インベントリ内部では回転しない. */ float rot = 0.0F; if (tileEntity.getWorldObj() != null) { rot = tileEntity.getWorldObj().getWorldTime() % 360L; } GL11.glPushMatrix(); /* * 位置の調整と色の設定. */ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); GL11.glRotatef(-180F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, -0.75F, 0.0F); /* * Y軸を回転させる処理. */ GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); modelCreeper.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
public void renderItem(ItemRenderType var1, ItemStack var2, Object... var3) { switch (RenderHelper.newRender[var1.ordinal()]) { case 1: GL11.glPushMatrix(); Minecraft.getMinecraft() .renderEngine .bindTexture("/blfngl/fallout/textures/AntiMaterielRifle.png"); boolean var4 = false; if (var3[1] != null && var3[1] instanceof EntityPlayer) { float var5; if ((EntityPlayer) var3[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && (!(Minecraft.getMinecraft().currentScreen instanceof GuiInventory) && !(Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) || RenderManager.instance.playerViewY != 180.0F)) { var4 = true; GL11.glTranslatef(0.7F, 0.5F, -0.25F); GL11.glRotatef(205.0F, 0.0F, 0.0F, 1.0F); } else { var5 = 0.3F; GL11.glTranslatef(0.7F, 0.5F, -0.2F); GL11.glScalef(var5, var5, var5); GL11.glRotatef(295.0F, 0.0F, 0.0F, 1.0F); } } this.model.render((Entity) var3[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); default: } }
@Override public void renderWithRotation(float scale) { if (!this.isHidden && this.showModel) { // if(!this.compiled) { // this.compileDisplayList(scale); // } GL11.glPushMatrix(); GL11.glTranslatef( this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); if (this.rotateAngleY != 0.0F) { GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F); } if (this.rotateAngleZ != 0.0F) { GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F); } // GL11.glCallList(this.displayList); GL11.glPopMatrix(); } }
public void render(float f) { if (field_1402_i) { return; } if (!showModel) { return; } if (!compiled) { compileDisplayList(f); } if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) { GL11.glPushMatrix(); GL11.glTranslatef(offsetX * f, offsetY * f, offsetZ * f); if (rotateAngleZ != 0.0F) { GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); } if (rotateAngleY != 0.0F) { GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); } if (rotateAngleX != 0.0F) { GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); } GL11.glCallList(displayList); GL11.glPopMatrix(); } else if (offsetX != 0.0F || offsetY != 0.0F || offsetZ != 0.0F) { GL11.glTranslatef(offsetX * f, offsetY * f, offsetZ * f); GL11.glCallList(displayList); GL11.glTranslatef(-offsetX * f, -offsetY * f, -offsetZ * f); } else { GL11.glCallList(displayList); } }
@Override @SideOnly(Side.CLIENT) public void preRender( Entity entity, BodyPart[] parts, BodyPartLocation location, ModelBase model) { RenderBlocks renderBlocks = new RenderBlocks(); ClientProxy.bindTexture(TextureMap.locationItemsTexture); GL11.glEnable(GL11.GL_CULL_FACE); if (location == BodyPartLocation.Torso) { GL11.glPushMatrix(); GL11.glScalef(1.0F, -1.0F, 1.0F); GL11.glTranslatef(0.4F, 0.4F, 0.0F); GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F); renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); GL11.glTranslatef(0.1F, 0.0F, -0.4F); GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F); renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); GL11.glPopMatrix(); } if (location == BodyPartLocation.Head) { GL11.glPushMatrix(); head[0].postRender(0.0625F); GL11.glScalef(1.0F, -1.0F, 1.0F); GL11.glTranslatef(0.0F, 0.75F, -0.1F); GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F); renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); // head GL11.glPopMatrix(); } GL11.glDisable(GL11.GL_CULL_FACE); ClientProxy.bindTexture(texture); }
public void postRender(float f) { if (field_1402_i) { return; } if (!showModel) { return; } if (!compiled) { compileDisplayList(f); } if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) { GL11.glTranslatef(offsetX * f, offsetY * f, offsetZ * f); if (rotateAngleZ != 0.0F) { GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); } if (rotateAngleY != 0.0F) { GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); } if (rotateAngleX != 0.0F) { GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); } } else if (offsetX != 0.0F || offsetY != 0.0F || offsetZ != 0.0F) { GL11.glTranslatef(offsetX * f, offsetY * f, offsetZ * f); } }
protected void func_77076_a(EntityEnderman p_77076_1_, float p_77076_2_) { super.func_77029_c(p_77076_1_, p_77076_2_); if (p_77076_1_.func_70822_p() > 0) { GL11.glEnable('\u803a'); GL11.glPushMatrix(); float var3 = 0.5F; GL11.glTranslatef(0.0F, 0.6875F, -0.75F); var3 *= 1.0F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(-var3, -var3, var3); int var4 = p_77076_1_.func_70070_b(p_77076_2_); int var5 = var4 % 65536; int var6 = var4 / 65536; OpenGlHelper.func_77475_a( OpenGlHelper.field_77476_b, (float) var5 / 1.0F, (float) var6 / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.func_76985_a("/terrain.png"); this.field_76988_d.func_78600_a( Block.field_71973_m[p_77076_1_.func_70822_p()], p_77076_1_.func_70824_q(), 1.0F); GL11.glPopMatrix(); GL11.glDisable('\u803a'); } }
private void renderAModelAt( TileEntityResistiveHeater tileEntity, double x, double y, double z, float partialTick) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ResistiveHeater.png")); switch (tileEntity.facing) { case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break; case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break; case 4: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break; case 5: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break; } GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); model.render(0.0625F, tileEntity.isActive, field_147501_a.field_147553_e); GL11.glPopMatrix(); }
private void renderAModelAt( TileEntityBioGenerator tileEntity, double x, double y, double z, float partialTick) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); func_110628_a(MekanismUtils.getResource(ResourceType.RENDER, "BioGenerator.png")); switch (tileEntity.facing) { case 2: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break; case 3: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break; case 4: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break; case 5: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break; } GL11.glRotatef(180, 0f, 0f, 1f); model.render(0.0625F, tileEntity.isActive ? tileEntity.getMatrix() : 0); GL11.glPopMatrix(); }
/** R_RotateForEntity */ final void R_RotateForEntity(entity_t e) { GL11.glTranslatef(e.origin[0], e.origin[1], e.origin[2]); GL11.glRotatef(e.angles[1], 0, 0, 1); GL11.glRotatef(-e.angles[0], 0, 1, 0); GL11.glRotatef(-e.angles[2], 1, 0, 0); }
private static void renderSun( float partialTickTime, WorldClient world, TextureManager renderEngine, Tessellator tessellator, float offset, float factor, float yangle, float size, ResourceLocation sun) { GL11.glTranslatef(0.0F, 0.0F, 0.0F); GL11.glRotatef(yangle, 0.0F, 1.0F, 0.0F); float angle = world.provider.calculateCelestialAngle( world.getWorldInfo().getWorldTime(), partialTickTime); angle = angle * factor + offset; GL11.glRotatef(angle * 360.0F, 1.0F, 0.0F, 0.0F); renderEngine.bindTexture(sun); tessellator.startDrawingQuads(); tessellator.addVertexWithUV((-size), 100.0D, (-size), 0.0D, 0.0D); tessellator.addVertexWithUV(size, 100.0D, (-size), 1.0D, 0.0D); tessellator.addVertexWithUV(size, 100.0D, size, 1.0D, 1.0D); tessellator.addVertexWithUV((-size), 100.0D, size, 0.0D, 1.0D); tessellator.draw(); }
@Override public void renderTileEntityAt( TileEntity tileentity, double d0, double d1, double d2, float partialTicks) { TileAnimationTablet tile = (TileAnimationTablet) tileentity; int meta = tile.getBlockMetadata() & 7; if (meta < 2) meta = 2; // Just in case int rotation = meta == 2 ? 270 : meta == 3 ? 90 : meta == 4 ? 0 : 180; GL11.glPushMatrix(); GL11.glTranslated(d0, d1, d2); renderOverlay(tile, overlayCenter, -1, false, false, 0.65, 0.13F, 0F); if (tile.leftClick) renderOverlay(tile, overlayLeft, 1, false, true, 1, 0.13F, 0F); else renderOverlay(tile, overlayRight, 1, false, true, 1, 0.131F, 0F); renderOverlay(tile, overlayIndent, 0, false, false, 0.5F, 0.13F, rotation + 90F); GL11.glRotatef(rotation, 0F, 1F, 0F); GL11.glTranslated(0.1, 0.2 + Math.cos(System.currentTimeMillis() / 600D) / 18F, 0.5); float[] translations = TRANSLATIONS[meta - 2]; GL11.glTranslatef(translations[0], translations[1], translations[2]); GL11.glScalef(0.8F, 0.8F, 0.8F); GL11.glTranslatef(0.5F, 0F, 0.5F); GL11.glRotatef(tile.swingProgress, 0F, 0F, 1F); GL11.glTranslatef(-0.5F, 0F, -0.5F); GL11.glTranslatef(-tile.swingProgress / 250F, tile.swingProgress / 1000F, 0F); GL11.glRotatef((float) Math.cos(System.currentTimeMillis() / 400F) * 5F, 1F, 0F, 1F); renderItem(tile); GL11.glPopMatrix(); }
protected void func_77047_a(EntityIronGolem par1EntityIronGolem, float par2) { super.renderEquippedItems(par1EntityIronGolem, par2); if (par1EntityIronGolem.func_70853_p() == 0) { return; } else { GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glPushMatrix(); GL11.glRotatef( 5F + (180F * field_77050_a.ironGolemRightArm.rotateAngleX) / (float) Math.PI, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); float f = 0.8F; GL11.glScalef(f, -f, f); int i = par1EntityIronGolem.getBrightnessForRender(par2); int j = i % 0x10000; int k = i / 0x10000; OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); loadTexture("/terrain.png"); renderBlocks.renderBlockAsItem(Block.plantRed, 0, 1.0F); GL11.glPopMatrix(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); return; } }
public void drawPlayerOnGui( Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5) { final float pitchBefore = par0Minecraft.thePlayer.rotationPitch; GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glPushMatrix(); GL11.glTranslatef(par1, par2, 50.0F); GL11.glScalef(-par3, par3, par3); GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); final float var6 = par0Minecraft.thePlayer.renderYawOffset; final float var7 = par0Minecraft.thePlayer.rotationYaw; final float var8 = par0Minecraft.thePlayer.rotationPitch; GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); RenderHelper.enableStandardItemLighting(); GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-((float) Math.atan(this.rotation / 40.0F)) * 00.0F, 1.0F, 0.0F, 0.0F); par0Minecraft.thePlayer.renderYawOffset = this.rotation; par0Minecraft.thePlayer.rotationYaw = this.rotation; par0Minecraft.thePlayer.rotationPitch = 0; par0Minecraft.thePlayer.rotationYawHead = par0Minecraft.thePlayer.rotationYaw; GL11.glTranslatef(0.0F, par0Minecraft.thePlayer.yOffset, 0.0F); RenderManager.instance.playerViewY = 180.0F; RenderManager.instance.renderEntityWithPosYaw( par0Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); par0Minecraft.thePlayer.renderYawOffset = var6; par0Minecraft.thePlayer.rotationYaw = var7; // par0Minecraft.thePlayer.rotationPitch = var8; GL11.glPopMatrix(); RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); par0Minecraft.thePlayer.rotationPitch = pitchBefore; }
public void renderAnuAt( TileEntityAnubiteStatue tileentity, double x, double y, double z, float f) { int i1 = 0; if (tileentity.hasWorldObj()) { i1 = tileentity.getBlockMetadata(); } short short1 = 0; if (i1 == 2) { short1 = 360; } if (i1 == 3) { short1 = 180; } if (i1 == 4) { short1 = 90; } if (i1 == 5) { short1 = -90; } GL11.glPushMatrix(); GL11.glTranslatef(0f, 0f, 0f); GL11.glTranslated((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef((float) short1 * -1F, 0.0F, 1.0F, 0.0F); GL11.glPushMatrix(); this.bindTexture(texture); this.modelBlock.renderBlock(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
@Optional.Method(modid = Mods.OpenComputers) public void render(ItemStack stack, MountPoint mountPoint, Robot robot, float pt) { if (!isUpgrade(stack)) { return; } Minecraft mc = Minecraft.getMinecraft(); TextureManager tm = mc.getTextureManager(); switch (stack.getItemDamage()) { case 1: { tm.bindTexture(upgradeChatBox); drawSimpleBlock(mountPoint, 0, true); break; } case 2: { if (mountPoint.name.equals(MountPointName.TopLeft) || mountPoint.name.equals(MountPointName.TopRight)) { float degrees = robot.shouldAnimate() ? ((robot.world().getTotalWorldTime() + (robot.hashCode() ^ 0xFF)) % 160 + pt) / 160F * 360F : 0F; if (mountPoint.name.equals(MountPointName.TopRight)) { degrees = 360 - degrees; } GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); tm.bindTexture(modelRadar); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glRotatef(180, 1, 0, 0); GL11.glRotatef( mountPoint.rotation.getW(), mountPoint.rotation.getX(), mountPoint.rotation.getY(), mountPoint.rotation.getZ()); GL11.glTranslatef(0F, -0.8F, 0F); GL11.glTranslatef( mountPoint.offset.getX(), mountPoint.offset.getY(), mountPoint.offset.getZ()); GL11.glScalef(0.3f, 0.3f, 0.3f); GL11.glPushMatrix(); radarModel.render(Math.max(degrees, 0)); GL11.glPopMatrix(); GL11.glPopAttrib(); } else { tm.bindTexture(upgradeRadar); drawSimpleBlock(mountPoint, 0, true); } break; } case 5: { tm.bindTexture(beepCard); drawSimpleBlock(mountPoint, 0, true); break; } } }
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { if (modelID != this.getRenderId()) { return; } GL11.glPushMatrix(); float scale = 0.0625f / 4.0f; GL11.glScalef(scale, scale, scale); // GL11.glRotatef(90, 1, 0, 0); GL11.glRotatef(90, 0, -1, 0); this.bind(windmillTextures); ((ModelWindmill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); GL11.glRotatef( -(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime() / 50) % 360, 0, 0, 1); modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); GL11.glPopMatrix(); this.bind(MC_BLOCK_SHEET); }
protected void renderModel(float bladeRotatation, int face, int height) { float[] rot = ITorque.forgeDiretctionToRotationMatrix[face]; if (rot[0] != 0) { GL11.glRotatef(rot[0], 1, 0, 0); } if (rot[1] != 0) { GL11.glRotatef(rot[1], 0, 1, 0); } if (rot[2] != 0) { GL11.glRotatef(rot[2], 0, 0, 1); } float textureWidth = model.textureWidth(); float textureHeight = model.textureHeight(); GL11.glRotatef(bladeRotatation, 0, 0, 1); windmillShaft.render(model.textureWidth(), model.textureHeight()); for (int i = 0; i < 4; i++) { GL11.glRotatef(90, 0, 0, 1); GL11.glPushMatrix(); bladeShaft.render(textureWidth, textureHeight); for (int k = 1; k < height; k++) { blade.render(textureWidth, textureHeight); if (k == height - 1) { bladeJoint.render(textureWidth, textureHeight); } if (k < height - 1) { GL11.glTranslatef(0, 1, 0); } } GL11.glPopMatrix(); } }
private void renderWhirlwind( EntityWhirlwind whirlwind, double x, double y, double z, float f, float f1) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(rLoc); Tessellator tessellator = Tessellator.instance; IIcon IIcon = AMParticleIcons.instance.getIconByName("wind"); GL11.glTranslated(x, y, z); float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; float min_u = IIcon.getMinU(); float min_v = IIcon.getMinV(); float max_u = IIcon.getMaxU(); float max_v = IIcon.getMaxV(); GL11.glRotatef(180F - RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setBrightness(0xF00F0); tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, min_u, max_v); tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, max_u, max_v); tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, max_u, min_v); tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, min_u, min_v); tessellator.draw(); GL11.glPopMatrix(); }