List of usage examples for org.lwjgl.opengl GL11 glDisable
public static void glDisable(@NativeType("GLenum") int target)
From source file:com.pahimar.ee3.client.renderer.item.ItemAludelRenderer.java
License:LGPL
private void renderAludel(float x, float y, float z, float scale) { GL11.glPushMatrix();//from w ww .j a v a 2 s .com GL11.glDisable(GL11.GL_LIGHTING); // Scale, Translate, Rotate GL11.glScalef(scale, scale, scale); GL11.glTranslatef(x, y, z); GL11.glRotatef(-90F, 1F, 0, 0); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALUDEL); // Render modelAludel.render(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); }
From source file:com.pahimar.ee3.client.renderer.item.ItemCalcinatorRenderer.java
License:LGPL
private void renderCalcinator(float x, float y, float z, float scale) { GL11.glPushMatrix();//from w w w . j a v a 2 s .c om GL11.glDisable(GL11.GL_LIGHTING); // Scale, Translate, Rotate GL11.glScalef(scale, scale, scale); GL11.glTranslatef(x, y, z); GL11.glRotatef(-90F, 1F, 0, 0); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_CALCINATOR); // Render modelCalcinator.render(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); }
From source file:com.pahimar.ee3.client.renderer.item.ItemGlassBellRenderer.java
License:LGPL
private void renderGlassBell(float x, float y, float z, float scale) { GL11.glPushMatrix();/*from w w w . j ava 2 s .c o m*/ GL11.glDisable(GL11.GL_LIGHTING); // Scale, Translate, Rotate GL11.glScalef(scale, scale, scale); GL11.glTranslatef(x, y, z); GL11.glRotatef(-90F, 1F, 0, 0); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_GLASS_BELL); // Render modelGlassBell.render(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); }
From source file:com.pahimar.ee3.client.renderer.RenderUtils.java
License:LGPL
public static void renderItemIntoGUI(FontRenderer fontRenderer, RenderEngine renderEngine, ItemStack itemStack, int x, int y, float opacity, float scale) { Icon icon = itemStack.getIconIndex(); GL11.glDisable(GL11.GL_LIGHTING); renderEngine.bindTexture(Textures.VANILLA_ITEM_TEXTURE_SHEET); int overlayColour = itemStack.getItem().getColorFromItemStack(itemStack, 0); float red = (overlayColour >> 16 & 255) / 255.0F; float green = (overlayColour >> 8 & 255) / 255.0F; float blue = (overlayColour & 255) / 255.0F; GL11.glColor4f(red, green, blue, opacity); drawTexturedQuad(x, y, icon, 16 * scale, 16 * scale, -90); GL11.glEnable(GL11.GL_LIGHTING);/*ww w .j a v a 2 s. com*/ }
From source file:com.pahimar.ee3.client.renderer.tileentity.TileEntityAlchemicalChestRenderer.java
License:LGPL
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { if (tileEntity instanceof TileAlchemicalChest) { TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) tileEntity; ForgeDirection direction = null; if (tileAlchemicalChest.getWorldObj() != null) { direction = ForgeDirection.getOrientation(tileAlchemicalChest.getBlockMetadata()); }/*from w ww . j a va 2 s .com*/ FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMICAL_CHEST); GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F); GL11.glScalef(1.0F, -1.0F, -1.0F); GL11.glTranslatef(0.5F, 0.5F, 0.5F); short angle = 0; if (direction != null) { if (direction == ForgeDirection.NORTH) { angle = 180; } else if (direction == ForgeDirection.SOUTH) { angle = 0; } else if (direction == ForgeDirection.WEST) { angle = 90; } else if (direction == ForgeDirection.EAST) { angle = -90; } } GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); float adjustedLidAngle = tileAlchemicalChest.prevLidAngle + (tileAlchemicalChest.lidAngle - tileAlchemicalChest.prevLidAngle) * tick; adjustedLidAngle = 1.0F - adjustedLidAngle; adjustedLidAngle = 1.0F - adjustedLidAngle * adjustedLidAngle * adjustedLidAngle; modelChest.chestLid.rotateAngleX = -(adjustedLidAngle * (float) Math.PI / 2.0F); modelChest.renderAll(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } }
From source file:com.pahimar.ee3.client.renderer.tileentity.TileEntityAlchemyTableRenderer.java
License:LGPL
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { if (tileEntity instanceof TileAlchemyTable) { // TODO Use the TileAlchemyTable to determine what circle to project on the server of the table TileAlchemyTable tileAlchemyTable = (TileAlchemyTable) tileEntity; GL11.glPushMatrix();/*from w ww .j av a2 s. co m*/ GL11.glDisable(GL11.GL_LIGHTING); // Scale, Translate, Rotate GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x + 0.0F, (float) y + 0.0F, (float) z + 1.0F); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMY_TABLE); // Render modelAlchemyTable.render(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } }
From source file:com.pahimar.ee3.client.renderer.tileentity.TileEntityAludelRenderer.java
License:LGPL
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { if (tileEntity instanceof TileAludel) { TileAludel tileAludel = (TileAludel) tileEntity; GL11.glPushMatrix();//from w ww .ja v a 2 s .c o m GL11.glDisable(GL11.GL_LIGHTING); // Scale, Translate, Rotate scaleTranslateRotate(x, y, z, tileAludel.getOrientation()); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALUDEL); // Render modelAludel.render(); GL11.glPopMatrix(); /** * Render the ghost item inside of the Aludel, slowly spinning */ GL11.glPushMatrix(); TileEntity tileGlassBell = tileAludel.worldObj.getBlockTileEntity(tileAludel.xCoord, tileAludel.yCoord + 1, tileAludel.zCoord); if (tileGlassBell instanceof TileGlassBell) { if (tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX) != null) { float scaleFactor = getGhostItemScaleFactor( tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX)); float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); EntityItem ghostEntityItem = new EntityItem(tileAludel.worldObj); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX)); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.25F, (float) z + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); customRenderItem.doRenderItem(ghostEntityItem, 0, 0, 0, 0, 0); } } GL11.glPopMatrix(); GL11.glEnable(GL11.GL_LIGHTING); } }
From source file:com.pahimar.ee3.client.renderer.tileentity.TileEntityCalcinatorRenderer.java
License:LGPL
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { if (tileEntity instanceof TileCalcinator) { TileCalcinator tileCalcinator = (TileCalcinator) tileEntity; GL11.glPushMatrix();//w ww . ja v a 2 s . co m GL11.glDisable(GL11.GL_LIGHTING); // Scale, Translate, Rotate GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.0F, (float) z + 1.2F); GL11.glRotatef(45F, 0F, 1F, 0F); GL11.glRotatef(-90F, 1F, 0F, 0F); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_CALCINATOR); // Render modelCalcinator.renderPart("Calcinator"); if (tileCalcinator.getStackInSlot(TileCalcinator.OUTPUT_INVENTORY_INDEX) != null) { modelCalcinator.renderPart("Dust"); } GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } }
From source file:com.pahimar.ee3.client.renderer.tileentity.TileEntityEnergyCondenserRenderer.java
License:LGPL
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { if (tileEntity instanceof TileEnergyCondenser) { TileEnergyCondenser tileEnergyCondenser = (TileEnergyCondenser) tileEntity; ForgeDirection direction = null; if (tileEnergyCondenser.getWorldObj() != null) { direction = ForgeDirection.getOrientation(tileEnergyCondenser.getBlockMetadata()); }//from www.j a va 2s .co m FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ENERGY_CONDENSER); GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F); GL11.glScalef(1.0F, -1.0F, -1.0F); GL11.glTranslatef(0.5F, 0.5F, 0.5F); short angle = 0; if (direction != null) { if (direction == ForgeDirection.NORTH) { angle = 180; } else if (direction == ForgeDirection.SOUTH) { angle = 0; } else if (direction == ForgeDirection.WEST) { angle = 90; } else if (direction == ForgeDirection.EAST) { angle = -90; } } GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); float adjustedLidAngle = tileEnergyCondenser.prevLidAngle + (tileEnergyCondenser.lidAngle - tileEnergyCondenser.prevLidAngle) * tick; adjustedLidAngle = 1.0F - adjustedLidAngle; adjustedLidAngle = 1.0F - adjustedLidAngle * adjustedLidAngle * adjustedLidAngle; modelChest.chestLid.rotateAngleX = -(adjustedLidAngle * (float) Math.PI / 2.0F); modelChest.renderAll(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } }
From source file:com.pahimar.ee3.client.renderer.tileentity.TileEntityGlassBellRenderer.java
License:LGPL
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { if (tileEntity instanceof TileGlassBell) { TileGlassBell tileGlassBell = (TileGlassBell) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); /**/* ww w .jav a2s .c o m*/ * Render the Glass Bell */ GL11.glPushMatrix(); // Scale, Translate, Rotate renderGlassBellByOrientation(x, y, z, tileGlassBell.getOrientation()); // Bind texture FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_GLASS_BELL); modelGlassBell.render(); GL11.glPopMatrix(); /** * Render the ghost item inside of the Glass Bell, slowly spinning */ GL11.glPushMatrix(); if (tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX) != null) { float scaleFactor = getGhostItemScaleFactor( tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX)); float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); EntityItem ghostEntityItem = new EntityItem(tileGlassBell.worldObj); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack( tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX)); translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), x, y, z, tileGlassBell.getOrientation()); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); customRenderItem.doRenderItem(ghostEntityItem, 0, 0, 0, 0, 0); } GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); } }