List of usage examples for org.lwjgl.opengl GL11 glScaled
public static native void glScaled(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:makeo.gadomancy.client.gui.AdditionalGolemGui.java
License:LGPL
protected void drawGuiContainerForegroundLayer(int par1, int par2) { GL11.glPushMatrix();/*from w ww . j av a 2s . co m*/ GL11.glScaled(0.5D, 0.5D, 0.5D); if (this.threat >= 0) { drawInfoString("golemthreat." + this.threat + ".text"); } else { AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(this.golem); if (core != null) { drawInfoString(core.getUnlocalizedGuiText()); } else { drawInfoString("golemblurb." + this.golem.getCore() + ".text"); } } if (((ContainerGolem) this.inventorySlots).maxScroll > 0) { this.fontRendererObj.drawString(((ContainerGolem) this.inventorySlots).currentScroll + 1 + "/" + (((ContainerGolem) this.inventorySlots).maxScroll + 1), 323, 140, 14540253); } GL11.glPopMatrix(); }
From source file:makeo.gadomancy.client.renderers.entity.RenderGolemHelper.java
License:LGPL
public static void renderCore(EntityGolemBase golem, AdditionalGolemCore core) { GL11.glPushMatrix();// w ww . java 2s . c om GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0875F, -0.96F, 0.15F + (golem.getGolemDecoration().contains("P") ? 0.03F : 0.0F)); GL11.glScaled(0.175D, 0.175D, 0.175D); GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); ItemStack coreItem = core.getItem(); IIcon icon = coreItem.getItem().getIcon(coreItem, 0); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMinU(); float f4 = icon.getMaxV(); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.2F); GL11.glPopMatrix(); }
From source file:makeo.gadomancy.client.renderers.entity.RenderGolemHelper.java
License:LGPL
public static void renderCarriedItemsFix(EntityGolemBase golem) { GL11.glPushMatrix();/*from ww w . ja va2 s . c o m*/ GL11.glScaled(0.4D, 0.4D, 0.4D); GL11.glTranslatef(-0.5F, 2.5F, -1.25F); GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); ItemStack item = golem.getCarriedForDisplay(); int renderPass = 0; do { IIcon icon = item.getItem().getIcon(item, renderPass); if (icon != null) { Color color = new Color(item.getItem().getColorFromItemStack(item, renderPass)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F); GL11.glColor3f(1.0F, 1.0F, 1.0F); } renderPass++; } while (renderPass < item.getItem().getRenderPasses(item.getItemDamage())); GL11.glPopMatrix(); }
From source file:makeo.gadomancy.client.renderers.entity.RenderGolemHelper.java
License:LGPL
public static void renderToolItem(EntityGolemBase golem, ItemStack itemstack, ModelBase mainModel, RenderManager renderManager) {// w w w . jav a 2 s .c o m GL11.glPushMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float angle = (float) (0.195 * Math.PI / -1 * ((ModelGolem) mainModel).golemRightArm.rotateAngleX); float y = (float) (Math.cos(angle) * 1.15); float z = (float) (Math.sin(angle) * 1.15); GL11.glTranslatef(-0.25F, y, z * -0.5f); GL11.glRotated(angle / Math.PI * 180f, -1, 0, 0); float fs = 0.66F; GL11.glScalef(fs, fs, fs); net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient .getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper( net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); Item item = itemstack.getItem(); float f1; if (item instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType()))) { f1 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); f1 *= 0.75F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(-f1, -f1, f1); } else if (item == Items.bow) { f1 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f1, -f1, f1); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else if (item.isFull3D()) { f1 = 0.625F; if (item.shouldRotateAroundWhenRendering()) { GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -0.125F, 0.0F); } GL11.glTranslatef(0.0F, 0.1875F, 0.0F); GL11.glScalef(f1, -f1, f1); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else { f1 = 0.375F; GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); GL11.glScalef(f1, f1, f1); GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); } float f2; int i; float f5; if (itemstack.getItem().requiresMultipleRenderPasses()) { for (i = 0; i < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++i) { int j = itemstack.getItem().getColorFromItemStack(itemstack, i); f5 = (float) (j >> 16 & 255) / 255.0F; f2 = (float) (j >> 8 & 255) / 255.0F; float f3 = (float) (j & 255) / 255.0F; GL11.glColor4f(f5, f2, f3, 1.0F); renderManager.itemRenderer.renderItem(golem, itemstack, i); } } else { i = itemstack.getItem().getColorFromItemStack(itemstack, 0); float f4 = (float) (i >> 16 & 255) / 255.0F; f5 = (float) (i >> 8 & 255) / 255.0F; f2 = (float) (i & 255) / 255.0F; GL11.glColor4f(f4, f5, f2, 1.0F); renderManager.itemRenderer.renderItem(golem, itemstack, 0); } GL11.glScaled(1.0D, 1.0D, 1.0D); GL11.glPopMatrix(); }
From source file:matteroverdrive.client.render.entity.EntityRendererRangedRougeAndroid.java
License:Open Source License
@Override protected void func_82422_c() { GL11.glTranslated(0, 0.2, -0.3); GL11.glRotatef(-97, 0, 0, 1.0F); GL11.glRotatef(-60, 0.0F, 1.0F, 0.0F); GL11.glScaled(0.6, 0.6, 0.6); }
From source file:matteroverdrive.client.render.entity.EntityRendererRougeAndroid.java
License:Open Source License
@Override protected void preRenderCallback(EntityLivingBase entityLiving, float p_77041_2_) { if (entityLiving instanceof EntityRougeAndroidMob) { if (((EntityRougeAndroidMob) entityLiving).getIsLegendary()) { GL11.glScaled(1.5, 1.5, 1.5); }//from w w w.ja v a 2 s . c o m } super.preRenderCallback(entityLiving, p_77041_2_); }
From source file:matteroverdrive.gui.element.ElementItemPreview.java
License:Open Source License
@Override public void drawForeground(int mouseX, int mouseY) { if (itemStack != null) { GL11.glPushMatrix();//from ww w . j a v a2s .co m GL11.glTranslatef(this.posX + sizeX / 2 - 9 * itemSize, this.posY + sizeY / 2 - 9 * itemSize, 0); GL11.glScaled(itemSize, itemSize, itemSize); RenderUtils.renderStack(0, 0, 32, itemStack, renderOverlay); GL11.glPopMatrix(); } }
From source file:matteroverdrive.gui.element.ElementModelPreview.java
License:Open Source License
public void Transform() { GL11.glTranslatef(posX, posY, 80); GL11.glScaled(60, 60, 60); GL11.glRotatef(-90, 0, 1, 0); GL11.glRotatef(210, 0, 0, 1); GL11.glRotatef(-25, 0, 1, 0); }
From source file:matteroverdrive.guide.GuideElementPreview.java
License:Open Source License
@Override public void drawElement(int width, int mouseX, int mouseY) { if (itemStack != null) { GL11.glPushMatrix();/*from w ww. j a v a 2 s . co m*/ if (textAlign == 1) GL11.glTranslated(width / 2 - 8 * size, 0, 0); else if (textAlign == 2) GL11.glTranslated(width - 16 * size, 0, 0); GL11.glTranslated(marginLeft, marginTop, 0); GL11.glScaled(size, size, size); RenderUtils.renderStack(0, 0, itemStack); GL11.glPopMatrix(); } }
From source file:matteroverdrive.guide.GuideElementRecipe.java
License:Open Source License
private void renderStack(ItemStack stack, int x, int y) { if (stack != null) { GL11.glPushMatrix();/*from w w w. j a va2s . c o m*/ GL11.glTranslated(10 + x * 33, 9 + y * 33, 0); GL11.glScaled(1.5, 1.5, 1.5); RenderUtils.renderStack(0, 0, stack); GL11.glPopMatrix(); } }