List of usage examples for org.lwjgl.opengl GL11 glTranslated
public static native void glTranslated(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:vazkii.botania.client.render.tile.RenderTileBrewery.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { brewery = (TileBrewery) tileentity;//from ww w . ja va 2 s .co m GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glScalef(1F, -1F, -1F); GL11.glTranslatef(0.5F, -1.5F, -0.5F); double time = ClientTickHandler.ticksInGame + f; if (!rotate) time = -1; model.render(this, time); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileCorporeaIndex.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partticks) { TileCorporeaIndex index = (TileCorporeaIndex) tile; GL11.glPushMatrix();//ww w .ja v a 2 s .c om GL11.glTranslated(x + 0.5, y, z + 0.5); Minecraft.getMinecraft().renderEngine.bindTexture(texture); float translation = move ? (float) ((Math.cos((index.ticksWithCloseby + (index.hasCloseby ? partticks : 0)) / 10F) * 0.5 + 0.5) * 0.25) : 0F; float rotation = move ? index.ticks * 2 + partticks : 0F; float scale = 0.6F; GL11.glScalef(scale, scale, scale); crystal.render(null, 0F, rotation, translation, 0F, 0F, 1F / 16F); GL11.glScalef(1F / scale, 1F / scale, 1F / scale); if (index.closeby > 0F) { float starScale = 0.02F; float starRadius = (float) TileCorporeaIndex.RADIUS * index.closeby + (index.closeby == 1F ? 0F : index.hasCloseby ? partticks : -partticks) * 0.2F; double rads = (index.ticksWithCloseby + partticks) * 2 * Math.PI / 180; double starX = Math.cos(rads) * starRadius; double starZ = Math.sin(rads) * starRadius; int color = 0xFF00FF; int seed = index.xCoord ^ index.yCoord ^ index.zCoord; GL11.glTranslated(starX, 0.3, starZ); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); GL11.glTranslated(-starX * 2, 0, -starZ * 2); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); GL11.glTranslated(starX, 0, starZ); rads = -rads; starX = Math.cos(rads) * starRadius; starZ = Math.sin(rads) * starRadius; GL11.glTranslated(starX, 0, starZ); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); GL11.glTranslated(-starX * 2, 0, -starZ * 2); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); GL11.glTranslated(starX, 0, starZ); } GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileFloatingFlower.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t) { IFloatingFlower flower = (IFloatingFlower) tile; GL11.glPushMatrix();/*from w ww.ja va2 s . com*/ GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); double worldTime = tile.getWorldObj() == null ? 0 : (double) (ClientTickHandler.ticksInGame + t); if (tile.getWorldObj() != null) worldTime += new Random(tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(1000); GL11.glTranslatef(0.5F, 0F, 0.5F); GL11.glRotatef(-((float) worldTime * 0.5F), 0F, 1F, 0F); GL11.glTranslatef(-0.5F, 0F, -0.5F); if (tile.getWorldObj() != null) { GL11.glTranslatef(0F, (float) Math.sin(worldTime * 0.05F) * 0.1F, 0F); GL11.glRotatef(4F * (float) Math.sin(worldTime * 0.04F), 1F, 0F, 0F); } Minecraft.getMinecraft().renderEngine.bindTexture(flower.getIslandType().getResource()); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 1.4F, 0.5F); GL11.glScalef(1F, -1F, -1F); model.render(); GL11.glPopMatrix(); ItemStack stack = flower.getDisplayStack(); IIcon icon = stack.getIconIndex(); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); GL11.glTranslatef(0.25F, 0.4F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F); ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); GL11.glColor3f(1F, 1F, 1F); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileIncensePlate.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks) { TileIncensePlate plate = (TileIncensePlate) tileentity; int meta = plate.getWorldObj() != null ? plate.getBlockMetadata() : 0; GL11.glPushMatrix();//from ww w . j a va 2 s .co m GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.5F, 1.5F, 0.5F); GL11.glScalef(1F, -1F, -1F); GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F); model.render(); GL11.glScalef(1F, -1F, -1F); ItemStack stack = plate.getStackInSlot(0); if (stack != null) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); float s = 0.4F; GL11.glTranslatef(0.1F, -1.46F, 0F); GL11.glScalef(s, s, s); GL11.glRotatef(180F, 0F, 1F, 0F); int renderPass = 0; do { IIcon icon = stack.getItem().getIcon(stack, renderPass); if (icon != null) { Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); GL11.glColor3f(1F, 1F, 1F); } renderPass++; } while (renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); GL11.glPopMatrix(); } GL11.glColor3f(1F, 1F, 1F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileMiniIsland.java
License:Creative Commons License
@Override public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t) { GL11.glPushMatrix();//w w w . j a v a 2s.co m GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); int worldTime = tile.getWorldObj() == null ? 0 : ClientTickHandler.ticksInGame; if (tile.getWorldObj() != null) worldTime += new Random(tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(1000); GL11.glTranslatef(0.5F, 0F, 0.5F); GL11.glRotatef(-(worldTime * 0.5F), 0F, 1F, 0F); GL11.glTranslatef(-0.5F, 0F, -0.5F); if (tile.getWorldObj() != null) { GL11.glTranslatef(0F, (float) Math.sin((double) worldTime * 0.05F) * 0.1F, 0F); GL11.glRotatef(4F * (float) Math.sin((double) worldTime * 0.04F), 1F, 0F, 0F); } Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 1.4F, 0.5F); GL11.glScalef(1F, -1F, -1F); model.render(); GL11.glPopMatrix(); int meta = tile.getWorldObj() == null ? forcedMetadata : tile.getBlockMetadata(); IIcon icon = BlockModFlower.icons[meta]; Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); GL11.glTranslatef(0.25F, 0.4F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F); ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); GL11.glColor3f(1F, 1F, 1F); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTilePrism.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partTicks) { TilePrism prism = (TilePrism) tile;/*from ww w . j a v a 2s. co m*/ GL11.glPushMatrix(); GL11.glTranslated(x, y, z); float pos = (float) Math.sin((ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F; ItemStack stack = prism.getStackInSlot(0); if (stack != null) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); ILens lens = (ILens) stack.getItem(); GL11.glPushMatrix(); GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glTranslatef(0F, 0F, pos); RenderLens.render(stack, lens.getLensColor(stack)); GL11.glPopMatrix(); } GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTilePump.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { TilePump pump = (TilePump) tileentity; GL11.glPushMatrix();/* ww w .j a va2s . c o m*/ GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); int meta = pump.getWorldObj() != null ? pump.getBlockMetadata() : 0; GL11.glTranslatef(0.5F, 0.5F, 0.5F); GL11.glScalef(1F, -1F, -1F); GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F); model.render(Math.max(0F, Math.min(8F, pump.innerRingPos + pump.moving * f))); GL11.glColor3f(1F, 1F, 1F); GL11.glScalef(1F, -1F, -1F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileRuneAltar.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partticks) { TileRuneAltar altar = (TileRuneAltar) tileentity; GL11.glPushMatrix();//from ww w .j a v a2s. c o m GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(x, y, z); int items = 0; for (int i = 0; i < altar.getSizeInventory(); i++) if (altar.getStackInSlot(i) == null) break; else items++; float[] angles = new float[altar.getSizeInventory()]; float anglePer = 360F / items; float totalAngle = 0F; for (int i = 0; i < angles.length; i++) angles[i] = totalAngle += anglePer; double time = ClientTickHandler.ticksInGame + partticks; for (int i = 0; i < altar.getSizeInventory(); i++) { GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(1F, 2.5F, 1F); GL11.glRotatef(angles[i] + (float) time, 0F, 1F, 0F); GL11.glTranslatef(2.25F, 0F, 0.5F); GL11.glRotatef(90F, 0F, 1F, 0F); GL11.glTranslated(0D, 0.15 * Math.sin((time + i * 10) / 5D), 0F); ItemStack stack = altar.getStackInSlot(i); Minecraft mc = Minecraft.getMinecraft(); if (stack != null) { mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); GL11.glScalef(2F, 2F, 2F); if (!ForgeHooksClient.renderEntityItem( new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) { GL11.glScalef(0.5F, 0.5F, 0.5F); if (stack.getItem() instanceof ItemBlock && RenderBlocks .renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(1F, 1.1F, 0F); renderBlocks.renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F); GL11.glTranslatef(-1F, -1.1F, 0F); GL11.glScalef(2F, 2F, 2F); } else { int renderPass = 0; do { IIcon icon = stack.getItem().getIcon(stack, renderPass); if (icon != null) { Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); GL11.glColor3f(1F, 1F, 1F); } renderPass++; } while (renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); } } } GL11.glPopMatrix(); } GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 1.8F, 0.5F); GL11.glRotatef(180F, 1F, 0F, 1F); int repeat = 15; cubes.renderSpinningCubes(2, repeat, repeat); GL11.glPopMatrix(); GL11.glTranslatef(0F, 0.2F, 0F); float scale = altar.getTargetMana() == 0 ? 0 : (float) altar.getCurrentMana() / (float) altar.getTargetMana() / 75F; if (scale != 0) { int seed = altar.xCoord ^ altar.yCoord ^ altar.zCoord; GL11.glTranslatef(0.5F, 0.7F, 0.5F); RenderHelper.renderStar(0x00E4D7, scale, scale, scale, seed); } GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileSparkChanger.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) { GL11.glPushMatrix();/* www. j av a2 s . c om*/ GL11.glTranslated(d0, d1, d2); GL11.glRotated(90F, 1F, 0F, 0F); GL11.glTranslatef(0.8F, 0.2F, -0.22F); GL11.glColor4f(1F, 1F, 1F, 1F); ItemStack stack = ((TileSparkChanger) tileentity).getStackInSlot(0); if (stack != null) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); float s = 0.6F; GL11.glScalef(s, s, s); GL11.glRotatef(180F, 0F, 1F, 0F); int renderPass = 0; do { IIcon icon = stack.getItem().getIcon(stack, renderPass); if (icon != null) { Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); GL11.glColor3f(1F, 1F, 1F); } renderPass++; } while (renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); GL11.glPopMatrix(); } GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glPopMatrix(); }
From source file:vazkii.botania.client.render.tile.RenderTileSpawnerClaw.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) { GL11.glPushMatrix();/* w w w.j ava 2s . c o m*/ GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.5F, 1.5F, 0.5F); GL11.glScalef(1F, -1F, -1F); model.render(); GL11.glColor3f(1F, 1F, 1F); GL11.glScalef(1F, -1F, -1F); GL11.glPopMatrix(); }