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:mods.railcraft.client.render.RenderTools.java
License:Open Source License
public static void renderString(String name, double xOffset, double yOffset, double zOffset) { RenderManager rm = RenderManager.instance; FontRenderer fontrenderer = rm.getFontRenderer(); float f = 1.6F; float f1 = 1 / 60F * f; GL11.glPushMatrix();//ww w . ja va 2s . c o m GL11.glTranslatef((float) xOffset, (float) yOffset, (float) zOffset); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-rm.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(rm.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-f1, -f1, f1); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); int j = fontrenderer.getStringWidth(name) / 2; tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); tessellator.addVertex((double) (-j - 1), (double) -1, 0.0D); tessellator.addVertex((double) (-j - 1), (double) 8, 0.0D); tessellator.addVertex((double) (j + 1), (double) 8, 0.0D); tessellator.addVertex((double) (j + 1), (double) -1, 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); fontrenderer.drawString(name, -fontrenderer.getStringWidth(name) / 2, 0, 553648127); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); fontrenderer.drawString(name, -fontrenderer.getStringWidth(name) / 2, 0, -1); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); }
From source file:mods.railcraft.client.render.RenderTunnelBore.java
License:Open Source License
public void render(EntityTunnelBore bore, double d, double d1, double d2, float yaw, float f1) { // System.out.println("Render Yaw = " + f); GL11.glPushMatrix();//ww w . ja va2 s .c o m long var10 = (long) bore.getEntityId() * 493286711L; var10 = var10 * var10 * 4392167121L + var10 * 98761L; float tx = (((float) (var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float ty = (((float) (var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float tz = (((float) (var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; GL11.glTranslatef(tx, ty, tz); GL11.glTranslatef((float) d, (float) d1, (float) d2); switch (bore.getFacing()) { case NORTH: yaw = 90; break; case EAST: yaw = 0; break; case SOUTH: yaw = 270; break; case WEST: yaw = 180; break; } GL11.glRotatef(yaw, 0.0F, 1.0F, 0.0F); float f3 = (float) bore.getRollingAmplitude() - f1; float f4 = (float) bore.getDamage() - f1; if (f4 < 0.0F) { f4 = 0.0F; } if (f3 > 0.0F) { float angle = (MathHelper.sin(f3) * f3 * f4) / 10F; angle = Math.min(angle, 0.8f); angle = Math.copySign(angle, bore.getRollingDirection()); GL11.glRotatef(angle, 1.0F, 0.0F, 0.0F); } float light = bore.getBrightness(f1); light = light + ((1.0f - light) * 0.4f); int j = 0xffffff; float c1 = (float) (j >> 16 & 0xff) / 255F; float c2 = (float) (j >> 8 & 0xff) / 255F; float c3 = (float) (j & 0xff) / 255F; GL11.glColor4f(c1 * light, c2 * light, c3 * light, 1.0F); IBoreHead head = bore.getBoreHead(); if (head != null) { bindTexture(head.getBoreTexture()); modelTunnelBore.setRenderBoreHead(true); } else { bindTexture(TEXTURE); modelTunnelBore.setRenderBoreHead(false); } GL11.glScalef(-1F, -1F, 1.0F); modelTunnelBore.setBoreHeadRotation(bore.getBoreRotationAngle()); modelTunnelBore.setBoreActive(bore.isMinecartPowered()); modelTunnelBore.render(0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:nedhyett.elementalcraft.block.stand.RenderStandWorld.java
License:Creative Commons License
@Override public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) { if (t == null | !(t instanceof TileStand)) { return;// w w w.ja v a 2 s . co m } TileStand ts = (TileStand) t; GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.065F, (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0, 0, 1); Minecraft.getMinecraft().renderEngine.bindTexture(texture); glEnable(32826); Utils.adjustLighting(t.getWorldObj(), t.xCoord, t.yCoord, t.zCoord, t.getWorldObj().getBlock(t.xCoord, t.yCoord, t.zCoord)); model.render(null, 0, 0, -0.1F, 0, 0, 0.0625F); glDisable(32826); GL11.glPopMatrix(); GL11.glPopMatrix(); if (doRender && ts.getWorldObj().getBlock(ts.xCoord, ts.yCoord + 1, ts.zCoord) == Blocks.air && ts.getWorldObj().getClosestPlayer(ts.xCoord, ts.yCoord, ts.zCoord, 25) != null && !mc.isGamePaused()) { if (!ts.hasItem()) { return; } ItemStack stack = ts.getHeldItem(); EntityItem ei = new EntityItem(ts.getWorldObj()); ei.hoverStart = 0; ei.setEntityItemStack(stack); glPushMatrix(); glColor4f(1.0F, 1.0F, 1.0F, 1.0F); glEnable(32826); glTranslatef((float) x, (float) y, (float) z); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 170F, 170F); glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float rotational = (Minecraft.getSystemTime()) / (3000.0F) * 300.0F; float scale = 2.0F; if (Block.getBlockFromItem(stack.getItem()) != null) { glPushMatrix(); glTranslatef(0.5F, 0.8F, 0.5F); GL11.glScalef(scale, scale, scale); glRotatef(rotational / SPEED, 0F, 1F, 0F); renderItems.doRender(ei, 0, 0, 0, 0, 1); glPopMatrix(); } else { glPushMatrix(); glTranslatef(0.5F, 1.1F, 0.5F); GL11.glScalef(scale, scale, scale); glRotatef(rotational / SPEED, 0F, 1.0F, 0F); renderItems.doRender(ei, 0, 0, 0, 0, 1.0F); glPopMatrix(); } glDisable(32826); glColor4f(1.0F, 1.0F, 1.0F, 1.0F); glPopMatrix(); } }
From source file:net.cortexmodders.lyoko.client.render.ItemRenderGlove.java
License:MIT License
private void renderEquipped(boolean firstPerson, Object... data) { GL11.glPushMatrix();/*from ww w . j a va 2 s . co m*/ Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(-55f, 0f, 0f, 1f); GL11.glRotatef(90f, 0f, 1f, 0f); GL11.glRotatef(90f, 1f, 0f, 0f); GL11.glRotatef(5f, 0f, 1f, 0f); float scale = 1.0F; if (data[1] != null && data[1] instanceof EntityPlayer) { if (!firstPerson && !((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))) scale = 1.0F; else { scale = 2F; GL11.glRotatef(15F, 1F, 0F, 0F); GL11.glTranslatef(0.3F, -0.5F, 0F); } EntityPlayer player = (EntityPlayer) data[1]; if (player.isUsingItem() && player.getItemInUse() != null && player.getItemInUse().getItem() instanceof ItemGlove) this.gloveModel.clenchHand(); else this.gloveModel.unclenchHand(); } GL11.glTranslatef(0.079f, 0.078f, -0.9f); GL11.glScalef(scale, scale, scale); this.gloveModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.03125F, firstPerson); GL11.glPopMatrix(); }
From source file:net.cortexmodders.lyoko.client.render.tileentity.RenderCable.java
License:MIT License
public void renderAModelAt(TileEntityCable tile, double x, double y, double z, float delta) { if (tile.getWorldObj() != null) tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord); // directory of the model's texture file this.bindTexture(texture); GL11.glPushMatrix();/* w w w. j a va 2s . c o m*/ { GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); GL11.glScalef(1.0F, -1F, -1F); this.configureSides(tile); this.model.renderModel(0.0625F, this.top, this.bottom, this.left, this.right, this.front, this.back); } GL11.glPopMatrix(); }
From source file:net.cortexmodders.lyoko.client.render.tileentity.RenderHolomapBlock.java
License:MIT License
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { float scale = 0.875F; GL11.glPushMatrix();/*from w ww .j a v a 2s. c om*/ // Binds the texture this.bindTexture(texture); GL11.glRotatef(180, 0F, 1F, 0F); // Use this or else model renders upside-down. GL11.glRotatef(180, 0F, 0F, 1F); GL11.glTranslatef(0F, -1.2F, 0F); GL11.glScalef(scale, scale, scale); this.model.render((TileEntityHolomap) null, 0F, 0F, 0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:net.cortexmodders.lyoko.client.render.tileentity.RenderScanner.java
License:MIT License
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { float scale = 0.875F; GL11.glPushMatrix();/* ww w .j a v a2 s . co m*/ // Binds the texture this.bindTexture(texture); GL11.glRotatef(180, 0F, 1F, 0F); GL11.glTranslatef(0F, 0.5F, 0F); GL11.glScalef(scale, scale, scale); this.model.render(null, 0F, 0F, 0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:net.cortexmodders.lyoko.client.render.tileentity.RenderSuperCalcConsole.java
License:MIT License
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { float scale = 0.875F; GL11.glPushMatrix();/*w w w.j a va 2 s . c om*/ // Binds the texture this.bindTexture(texture); GL11.glRotatef(180, 0F, 1F, 0F); GL11.glTranslatef(0F, 0.5F, 0F); GL11.glScalef(scale, scale, scale); this.model.render((TileEntity) null, 0F, 0F, 0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:net.jamcraft.chowtime.core.mobs.SeedMob.ModelSeedMob.java
License:Open Source License
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); if (this.isChild) { float f6 = 2.0F; // GL11.glPushMatrix(); // GL11.glTranslatef(0.0F, this.field_78145_g * f5, this.field_78151_h * f5); ///*from www.j a va 2s . co m*/ // GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); this.Head.render(f5); this.Base.render(f5); this.Shape1.render(f5); this.Leg.render(f5); this.Leg2.render(f5); this.FrontLeg.render(f5); this.FrontLeg2.render(f5); GL11.glPopMatrix(); } else { this.Head.render(f5); this.Shape1.render(f5); this.Base.render(f5); this.Shape1.render(f5); this.Leg.render(f5); this.Leg2.render(f5); this.FrontLeg.render(f5); this.FrontLeg2.render(f5); } // setRotationAngles(f, f1, f2, f3, f4, f5, entity); // Base.render(f5); // Leg.render(f5); // Leg2.render(f5); // Head.render(f5); // FrontLeg.render(f5); // FrontLeg2.render(f5); // Shape1.render(f5); }
From source file:net.kubin.inventory.InventoryItem.java
License:Apache License
public void renderHoldableObject(LightBuffer lightBuffer) { GL11.glPushMatrix();// w ww .ja va2s .c o m float scale = 0.1f / 16.0f; float light = lightBuffer.get(1, 1, 1) / 30.001f; GL11.glScalef(scale, scale, scale); GL11.glColor3f(0.5f * light, 0.5f * light, 0.5f * light); /* Render the texture */ for (float i = 0.0f; i < 0.02f; i += 0.002f) { if (i > 0.016f) { GL11.glColor3f(1.0f * light, 1.0f * light, 1.0f * light); } renderInventoryItem(); GL11.glTranslatef(0, 0, 0.002f / scale); } GL11.glPopMatrix(); }