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:matteroverdrive.guide.GuideElementTitle.java
License:Open Source License
@Override public void drawElement(int width, int mouseX, int mouseY) { GL11.glPushMatrix();/*w w w . j av a 2s. com*/ int titleWidth = (int) (getFontRenderer().getStringWidth(title) * size); int x = 0; if (textAlign == 1) { x = (width - marginLeft - marginRight) / 2 - titleWidth / 2; } else if (textAlign == 2) { x = (width - marginLeft - marginRight) - titleWidth; } GL11.glTranslated(x + marginLeft, marginTop, 0); GL11.glScaled(size, size, size); getFontRenderer().drawString(title, 0, 0, color.getColor()); GL11.glPopMatrix(); }
From source file:matteroverdrive.guide.infograms.InfogramCreates.java
License:Open Source License
@Override public void drawElement(int width, int mouseX, int mouseY) { bindTexture(background);//from w ww.ja va 2 s . com GL11.glColor3d(1, 1, 1); RenderUtils.drawPlane(marginLeft, marginTop, 0, 115, 36); if (from != null) { GL11.glPushMatrix(); GL11.glTranslated(marginLeft + 5, marginTop + 5, 0); GL11.glScaled(1.5, 1.5, 1.5); RenderUtils.renderStack(0, 0, from); GL11.glPopMatrix(); } if (to != null) { GL11.glPushMatrix(); GL11.glTranslated(marginLeft + 86, marginTop + 5, 0); GL11.glScaled(1.5, 1.5, 1.5); RenderUtils.renderStack(0, 0, to); GL11.glPopMatrix(); } }
From source file:matteroverdrive.guide.infograms.InfogramDepth.java
License:Open Source License
@Override public void drawElement(int width, int mouseX, int mouseY) { float minPercent = 1 - Math.min(minDepth, 64) / 64f; float maxPercent = 1 - Math.min(maxDepth, 64) / 64f; if (maxDepth >= 0) { getFontRenderer().drawString(Integer.toString(maxDepth) + "-", 8, 8 + (int) (46 * maxPercent), Reference.COLOR_HOLO_GREEN.getColor()); }/*from w w w . ja v a2 s . c o m*/ if (minDepth > 0) { getFontRenderer().drawString(Integer.toString(minDepth) + "-", 8, 8 + (int) (46 * minPercent), Reference.COLOR_HOLO_GREEN.getColor()); } bindTexture(terrain_background); GL11.glColor3d(1, 1, 1); RenderUtils.drawPlane(marginLeft + 20.5, marginTop + 8, 0, 72.5, 53); RenderUtils.beginStencil(); RenderUtils.drawStencil(marginLeft + 24, marginTop + 8 + (int) (53 * maxPercent), 24 + 69, 8 + (int) (53 * minPercent), 1); bindTexture(terrain_background_stripes); GL11.glColor3d(1, 1, 1); RenderUtils.drawPlane(marginLeft + 24, marginTop + 8, 0, 69, 53); RenderUtils.endStencil(); bindTexture(ore_lense_background); GL11.glColor3d(1, 1, 1); RenderUtils.drawPlane(marginLeft + 69, marginTop + 16, 0, 84, 41); if (stack != null) { GL11.glPushMatrix(); GL11.glTranslated(marginLeft + 123, marginTop + 21, 0); GL11.glScaled(1.5, 1.5, 1.5); RenderUtils.renderStack(0, 0, stack); GL11.glPopMatrix(); } }
From source file:net.jamcraft.chowtime.api.nei.IceCreamMakerHandler.java
License:Open Source License
@Override public void drawExtras(int recipe) { CachedICMakerRecipe crecipe = (CachedICMakerRecipe) arecipes.get(recipe); //render progress bar // drawProgressBar(79, 34, 176, 14, 20, 14, 24, 17); //render temperature GL11.glPushMatrix();/* w w w . j a v a 2 s. com*/ GL11.glScaled(0.51F, 0.51F, 0.51F); double tempD = ((double) crecipe.getTemp()) / 1000; String temp = Double.toString(tempD) + "\u00B0C"; GuiDraw.drawString(temp, 9, 55, 4210752, false); GL11.glPopMatrix(); // Tessellator tesser=Tessellator.instance; // tesser.startDrawing(); //render blank card // changeTexture("minestuck:textures/items/CardBlank.png"); // drawTexturedModalRect(21, 39, 0, 0, 16, 16,16,16); //render combo mode // GuiDraw.drawString(crecipe.mode ? "&&" : "||", 22, 18, 0); }
From source file:net.jamcraft.chowtime.core.client.gui.GuiICMaker.java
License:Open Source License
@Override protected void drawGuiContainerForegroundLayer(int x, int y) { String containerName = StatCollector.translateToLocal(te.getInventoryName()); String invName = StatCollector.translateToLocal("container.inventory"); fontRendererObj.drawString(containerName, xSize / 2 - fontRendererObj.getStringWidth(containerName) / 2, 6, 4210752);//from ww w . j a v a 2s. co m fontRendererObj.drawString(invName, xSize - fontRendererObj.getStringWidth(invName) - 5, ySize - 128 + 2, 4210752); GL11.glPushMatrix(); GL11.glScaled(0.51F, 0.51F, 0.51F); double tempD = ((double) te.getTemp()) / 1000; String temp = Double.toString(tempD) + "\u00B0C"; int width = fontRendererObj.getStringWidth(temp); fontRendererObj.drawString(temp, width / 2 - 12, 55, 4210752); GL11.glPopMatrix(); }
From source file:net.malisis.doors.door.renderer.ForcefieldRenderer.java
License:Open Source License
private void setTextureMatrix() { long elapsed = ar.getElapsedTime() / 50; int n = (int) (elapsed % 50); bindTexture(rl[n]);/*w w w .j a v a2 s . c o m*/ GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glLoadIdentity(); AxisAlignedBB aabb = tileEntity.getMultiBlock().getBounds(); double scaleX = 1, scaleY = 1; if (direction == ForgeDirection.UP) { scaleX = aabb.maxX - aabb.minX; scaleY = aabb.maxZ - aabb.minZ; if (aabb.maxZ - aabb.minZ > aabb.maxX - aabb.minX) GL11.glRotatef(90, 0, 0, 1); } else { scaleY = aabb.maxY - aabb.minY; if (direction == ForgeDirection.EAST) scaleX = aabb.maxZ - aabb.minZ; else if (direction == ForgeDirection.NORTH) scaleX = aabb.maxX - aabb.minX; } //GL11.glTranslatef(fx, fy, 0); GL11.glScaled(scaleX / 3, scaleY / 3, 1); GL11.glMatrixMode(GL11.GL_MODELVIEW); }
From source file:net.quetzi.bluepower.client.renderers.RenderItemBPPart.java
License:Open Source License
@SuppressWarnings("incomplete-switch") @Override//from w w w . j av a 2 s . co m public void renderItem(ItemRenderType type, ItemStack item, Object... data) { BPPart part = null; try { for (BPPart p : parts) if (p.getType().equals(PartRegistry.getPartIdFromItem(item))) { part = p; break; } if (part == null) { part = PartRegistry.createPartFromItem(item); if (part != null) parts.add(part); } } catch (Exception ex) { } if (part == null) { part = PartRegistry.createPart(PartRegistry.ICON_PART); } GL11.glPushMatrix(); { switch (type) { case ENTITY: GL11.glScaled(0.5, 0.5, 0.5); GL11.glTranslated(-0.5, 0, -0.5); if (item.getItemFrame() != null) GL11.glTranslated(0, -0.25, 0); break; case EQUIPPED: break; case EQUIPPED_FIRST_PERSON: break; case INVENTORY: GL11.glTranslated(0, -0.1, 0); break; } part.renderItem(type, item, data); } GL11.glPopMatrix(); }
From source file:net.roryclaasen.rorysmod.render.RenderRifle.java
License:Apache License
public void renderItem(ItemRenderType type, ItemStack item, Object... data) { boolean isFirstPerson = false; if (data.length > 1) { if (data[1] != null && data[1] instanceof EntityPlayer) { if (((EntityPlayer) data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) { isFirstPerson = true;// ww w . j a v a2 s . co m } } } switch (type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(RorysMod.MODID, "textures/models/laserRifle.png")); GL11.glRotatef(80F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(25F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-80F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(85F, 1F, 0.0F, 0.0F); GL11.glRotatef(-10F, 0, 0.0F, 1F); GL11.glTranslatef(-0.45F, 0.0F, 0.15F); float scale = 1.4F; GL11.glScaled(scale, scale, scale); rifle.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(new ResourceLocation(RorysMod.MODID, "textures/models/laserRifle.png")); if (isFirstPerson) { GL11.glRotatef(80F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(25F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-80F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-1F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(5.5F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.50F, 0.2F, -0.5F); float scale = 1.4F; GL11.glScaled(scale, scale, scale); rifle.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; } } default: { break; } } }
From source file:net.wurstclient.features.mods.BowAimbotMod.java
License:Open Source License
@Override public void onRender(float partialTicks) { if (target == null) return;/*from w ww . ja v a 2s.com*/ // GL settings GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glLineWidth(2); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glPushMatrix(); GL11.glTranslated(-mc.getRenderManager().renderPosX, -mc.getRenderManager().renderPosY, -mc.getRenderManager().renderPosZ); // set position GL11.glTranslated(target.posX, target.posY, target.posZ); // set size double boxWidth = target.width + 0.1; double boxHeight = target.height + 0.1; GL11.glScaled(boxWidth, boxHeight, boxWidth); // move to center GL11.glTranslated(0, 0.5, 0); double v = 1 / velocity; GL11.glScaled(v, v, v); // draw outline GL11.glColor4d(1, 0, 0, 0.5F * velocity); RenderUtils.drawOutlinedBox(TARGET_BOX); // draw box GL11.glColor4d(1, 0, 0, 0.25F * velocity); RenderUtils.drawSolidBox(TARGET_BOX); GL11.glPopMatrix(); // GL resets GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_LINE_SMOOTH); }
From source file:nightkosh.gravestone_extended.models.entity.ModelBarghest.java
License:LGPL
@Override public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7) { GL11.glPushMatrix();/*from w ww . j av a 2 s. c o m*/ GL11.glScaled(2, 2, 2); GL11.glTranslated(0, -0.7, 0); super.render(entity, par2, par3, par4, par5, par6, par7); GL11.glPopMatrix(); }