List of usage examples for org.lwjgl.opengl GL11 glScalef
public static native void glScalef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);
From source file:fr.mcnanotech.kevin_68.nanotechmod.city.client.renderer.tileentity.TileEntityTrashCanRender.java
License:Creative Commons License
public void renderTileEntityTrashCanAt(TileEntityTrashCan tileentity, double x, double y, double z, float tick) { GL11.glPushMatrix();//from www.j a va 2 s . com GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); this.bindTexture(texture); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glScalef(0.8F, 0.8F, 0.8F); GL11.glTranslatef(0.0F, 0.38F, 0.0F); this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemAltersRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED: { GL11.glPushMatrix();//from w ww . j av a 2 s.c o m Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(-80, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.4F, -0.08F, 0.0F); GL11.glScalef(2.0F, 2.0F, 2.0F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(-80, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.4F, -0.08F, 0.0F); GL11.glScalef(2.0F, 2.0F, 2.0F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } case ENTITY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(0, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.4F, 0.2F, 0.0F); GL11.glScalef(2.0F, 2.0F, 2.0F); if (RenderItem.renderInFrame) { GL11.glScalef(0.3F, 0.3F, 0.3F); GL11.glTranslatef(-0.7F, 0.2F, 0.1F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); } model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } default: break; } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemBlockPortableChestRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (item.getItemDamage() == 0) { switch (type) { case EQUIPPED: { GL11.glPushMatrix();//w w w .jav a 2 s .co m Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-25F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, -0.5F, 0.0F); model.render(0.0625F); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-86.9F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.9F, -0.8F, -1.8F); GL11.glScaled(1.5F, 1.5F, 1.5F); model.render(0.0625F); GL11.glPopMatrix(); GL11.glPushMatrix(); if (((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin() != null) { player = ((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin(); } else { player = steveTextures; } Minecraft.getMinecraft().renderEngine.bindTexture(player); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-120F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(2.0F, 0.5F, 0.2F); modelB.bipedRightArm.render(0.0625F); GL11.glPopMatrix(); GL11.glPushMatrix(); if (((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin() != null) { player = ((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin(); } else { player = steveTextures; } Minecraft.getMinecraft().renderEngine.bindTexture(player); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-120F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.32F, 0.5F, 0.2F); modelB.bipedLeftArm.render(0.0625F); GL11.glPopMatrix(); break; } case ENTITY: { if (RenderItem.renderInFrame) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.2F, -1.25F, 0.0F); GL11.glScalef(1.4F, 1.4F, 1.4F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); model.render(0.0625F); GL11.glPopMatrix(); break; } } default: break; } } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemCrazyGlassesGunRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED: { GL11.glPushMatrix();/*from w w w. ja v a2 s .c o m*/ Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(75F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-30F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-65F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(110F, 1.0F, 1.0F, 0.0F); GL11.glTranslatef(0.45F, -0.1F, 0.1F); GL11.glScalef(2.0F, 2.0F, 2.0F); model.render(0.0625F, item); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(140F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, 0.0F, -0.8F); model.render(0.0625F, item); GL11.glPopMatrix(); break; } case INVENTORY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.0F, -0.2F, 0.5F); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); GL11.glScalef(1.7F, 1.7F, 1.7F); model.render(0.0625F, item); GL11.glPopMatrix(); break; } default: break; } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemDebugRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED: { GL11.glPushMatrix();/*from ww w. j av a 2s.c om*/ Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.4F, -0.6F, 0.0F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.4F, -0.6F, 0.0F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } case ENTITY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.4F, -0.6F, 0.0F); if (RenderItem.renderInFrame) { GL11.glScalef(1.2F, 1.2F, 1.2F); GL11.glTranslatef(-0.35F, -0.35F, 0.05F); } model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } default: break; } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemLightSaberRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { int red = (item.hasTagCompound() && item.getTagCompound().hasKey("red")) ? item.getTagCompound().getInteger("red") : 0;// w w w. j a v a 2 s . com int green = (item.hasTagCompound() && item.getTagCompound().hasKey("green")) ? item.getTagCompound().getInteger("green") : 0; int blue = (item.hasTagCompound() && item.getTagCompound().hasKey("blue")) ? item.getTagCompound().getInteger("blue") : 0; switch (type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(-140, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-0.65F, -1.35F, 0.0F); model.render(0.0625F, item, false); GL11.glColor3d((float) (red) / 255.0F, (float) (green) / 255.0F, (float) (blue) / 255.0F); model.render(0.0625F, item, true); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(-140, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-0.65F, -1.35F, 0.0F); model.render(0.0625F, item, false); GL11.glColor3d((float) (red) / 255.0F, (float) (green) / 255.0F, (float) (blue) / 255.0F); model.render(0.0625F, item, true); GL11.glPopMatrix(); break; } case ENTITY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(0, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.4F, 0.2F, 0.0F); GL11.glScalef(2.0F, 2.0F, 2.0F); if (RenderItem.renderInFrame) { GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(-1.1F, -0.5F, 0.1F); GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F); } model.render(0.0625F, item, false); GL11.glColor3d((float) (red) / 255.0F, (float) (green) / 255.0F, (float) (blue) / 255.0F); model.render(0.0625F, item, true); GL11.glPopMatrix(); break; } case INVENTORY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(45.F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(11.5F, -16.0F, 0.0F); GL11.glScalef(17F, 17F, 17F); model.render(0.0625F, item, false); GL11.glColor3d((float) (red) / 255.0F, (float) (green) / 255.0F, (float) (blue) / 255.0F); model.render(0.0625F, item, true); GL11.glPopMatrix(); break; } default: break; } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemScytheRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED: { GL11.glPushMatrix();/*from ww w . j av a 2 s.c o m*/ Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(140F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, 0.0F, -0.8F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(140F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, 0.0F, -0.8F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } case ENTITY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); if (RenderItem.renderInFrame) { GL11.glScalef(0.4F, 0.4F, 0.4F); GL11.glTranslatef(-0.9F, 0.5F, 0.0F); GL11.glRotatef(-26F, 0.0F, 0.0F, 1.0F); } GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(140F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, 0.0F, -0.8F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } default: break; } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.RenderCreeperDriller.java
License:Creative Commons License
protected void updateMobCreeperDrillerScale(MobCreeperDriller mob, float par2) { float var4 = mob.setCreeperFlashTime(par2); float var5 = 1.0F + MathHelper.sin(var4 * 100.0F) * var4 * 0.01F; if (var4 < 0.0F) { var4 = 0.0F; }/*from www. j av a2 s . c o m*/ if (var4 > 1.0F) { var4 = 1.0F; } var4 *= var4; var4 *= var4; float var6 = (1.0F + var4 * 0.4F) * var5; float var7 = (1.0F + var4 * 0.1F) / var5; GL11.glScalef(var6, var7, var6); }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.RenderFlyingCreeper.java
License:Creative Commons License
protected void updateMobFlyingCreeperScale(MobFlyingCreeper mob, float par2) { float var4 = mob.getCreeperFlashIntensity(par2); float var5 = 1.0F + MathHelper.sin(var4 * 100.0F) * var4 * 0.01F; if (var4 < 0.0F) { var4 = 0.0F; }/* w w w. ja v a 2 s.c o m*/ if (var4 > 1.0F) { var4 = 1.0F; } var4 *= var4; var4 *= var4; float var6 = (1.0F + var4 * 0.4F) * var5; float var7 = (1.0F + var4 * 0.1F) / var5; GL11.glScalef(var6, var7, var6); }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.RenderReinforcedFishingHook.java
License:Creative Commons License
public void doRenderFishHook(EntityReinforcedFishingHook entityFishHook, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix();//w w w . ja v a 2 s . c om GL11.glTranslatef((float) par2, (float) par4, (float) par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F, 0.5F); this.bindEntityTexture(entityFishHook); Tessellator tessellator = Tessellator.instance; byte b0 = 1; byte b1 = 2; float f2 = (b0 * 8 + 0) / 128.0F; float f3 = (b0 * 8 + 8) / 128.0F; float f4 = (b1 * 8 + 0) / 128.0F; float f5 = (b1 * 8 + 8) / 128.0F; float f6 = 1.0F; float f7 = 0.5F; float f8 = 0.5F; GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5); tessellator.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5); tessellator.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); tessellator.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4); tessellator.draw(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); if (entityFishHook.angler != null) { float f9 = entityFishHook.angler.getSwingProgress(par9); float f10 = MathHelper.sin(MathHelper.sqrt_float(f9) * (float) Math.PI); Vec3 vec3 = Vec3.createVectorHelper(-0.5D, 0.03D, 0.8D); vec3.rotateAroundX(-(entityFishHook.angler.prevRotationPitch + (entityFishHook.angler.rotationPitch - entityFishHook.angler.prevRotationPitch) * par9) * (float) Math.PI / 180.0F); vec3.rotateAroundY(-(entityFishHook.angler.prevRotationYaw + (entityFishHook.angler.rotationYaw - entityFishHook.angler.prevRotationYaw) * par9) * (float) Math.PI / 180.0F); vec3.rotateAroundY(f10 * 0.5F); vec3.rotateAroundX(-f10 * 0.7F); double d3 = entityFishHook.angler.prevPosX + (entityFishHook.angler.posX - entityFishHook.angler.prevPosX) * par9 + vec3.xCoord; double d4 = entityFishHook.angler.prevPosY + (entityFishHook.angler.posY - entityFishHook.angler.prevPosY) * par9 + vec3.yCoord; double d5 = entityFishHook.angler.prevPosZ + (entityFishHook.angler.posZ - entityFishHook.angler.prevPosZ) * par9 + vec3.zCoord; double d6 = entityFishHook.angler == Minecraft.getMinecraft().thePlayer ? 0.0D : (double) entityFishHook.angler.getEyeHeight(); if (this.renderManager.options.thirdPersonView > 0 || entityFishHook.angler != Minecraft.getMinecraft().thePlayer) { float f11 = (entityFishHook.angler.prevRenderYawOffset + (entityFishHook.angler.renderYawOffset - entityFishHook.angler.prevRenderYawOffset) * par9) * (float) Math.PI / 180.0F; double d7 = MathHelper.sin(f11); double d8 = MathHelper.cos(f11); d3 = entityFishHook.angler.prevPosX + (entityFishHook.angler.posX - entityFishHook.angler.prevPosX) * par9 - d8 * 0.35D - d7 * 0.85D; d4 = entityFishHook.angler.prevPosY + d6 + (entityFishHook.angler.posY - entityFishHook.angler.prevPosY) * par9 - 0.45D; d5 = entityFishHook.angler.prevPosZ + (entityFishHook.angler.posZ - entityFishHook.angler.prevPosZ) * par9 - d7 * 0.35D + d8 * 0.85D; } double d9 = entityFishHook.prevPosX + (entityFishHook.posX - entityFishHook.prevPosX) * par9; double d10 = entityFishHook.prevPosY + (entityFishHook.posY - entityFishHook.prevPosY) * par9 + 0.25D; double d11 = entityFishHook.prevPosZ + (entityFishHook.posZ - entityFishHook.prevPosZ) * par9; double d12 = ((float) (d3 - d9)); double d13 = ((float) (d4 - d10)); double d14 = ((float) (d5 - d11)); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); tessellator.startDrawing(3); tessellator.setColorOpaque_I(0); byte b2 = 16; for (int i = 0; i <= b2; ++i) { float f12 = (float) i / (float) b2; tessellator.addVertex(par2 + d12 * f12, par4 + d13 * (f12 * f12 + f12) * 0.5D + 0.25D, par6 + d14 * f12); } tessellator.draw(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); } }