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:com.professorvennie.machinerycraft.client.renderer.tileentity.TileEntityRendererCable.java
License:Creative Commons License
public void drawStriaght(ForgeDirection direction) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads();/* w w w. j a va2 s . c o m*/ { GL11.glTranslated(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.SOUTH) || direction.equals(ForgeDirection.NORTH)) { GL11.glRotatef(90, 1, 0, 0); } else if (direction.equals(ForgeDirection.WEST) || direction.equals(ForgeDirection.EAST)) { GL11.glRotatef(90, 0, 0, 1); } GL11.glTranslated(-0.5F, -0.5F, -0.5F); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 0, 1 - 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 1 - 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 0, 11 * pixel / 2, 26 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); } tessellator.draw(); GL11.glTranslated(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.SOUTH) || direction.equals(ForgeDirection.NORTH)) { GL11.glRotatef(-90, 1, 0, 0); } else if (direction.equals(ForgeDirection.WEST) || direction.equals(ForgeDirection.EAST)) { GL11.glRotatef(-90, 0, 0, 1); } GL11.glTranslated(-0.5F, -0.5F, -0.5F); }
From source file:com.professorvennie.machinerycraft.client.renderer.tileentity.TileEntityRendererCable.java
License:Creative Commons License
public void drawConnector(ForgeDirection direction) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads();/*from w ww. j av a2 s . co m*/ { GL11.glTranslated(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.UP)) { //rotate } else if (direction.equals(ForgeDirection.DOWN)) { GL11.glRotatef(180, 1, 0, 0); } else if (direction.equals(ForgeDirection.SOUTH)) { GL11.glRotatef(90, 1, 0, 0); } else if (direction.equals(ForgeDirection.NORTH)) { GL11.glRotatef(270, 1, 0, 0); } else if (direction.equals(ForgeDirection.WEST)) { GL11.glRotatef(90, 0, 0, 1); } else if (direction.equals(ForgeDirection.EAST)) { GL11.glRotatef(270, 0, 0, 1); } GL11.glTranslated(-0.5F, -0.5F, -0.5F); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); } tessellator.draw(); GL11.glTranslated(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.UP)) { //rotate } else if (direction.equals(ForgeDirection.DOWN)) { GL11.glRotatef(-180, 1, 0, 0); } else if (direction.equals(ForgeDirection.SOUTH)) { GL11.glRotatef(-90, 1, 0, 0); } else if (direction.equals(ForgeDirection.NORTH)) { GL11.glRotatef(-270, 1, 0, 0); } else if (direction.equals(ForgeDirection.WEST)) { GL11.glRotatef(-90, 0, 0, 1); } else if (direction.equals(ForgeDirection.EAST)) { GL11.glRotatef(-270, 0, 0, 1); } GL11.glTranslated(-0.5F, -0.5F, -0.5F); }
From source file:com.professorvennie.machinerycraft.machines.windmill.TileEntityRendererwindmill.java
License:Creative Commons License
public void drawConnector(ForgeDirection direction) { ResourceLocation texture = new ResourceLocation(Reference.MOD_ID, "textures/model/cable.png"); float texturePixel = 1F / 32F; Tessellator tessellator = Tessellator.instance; this.bindTexture(texture); tessellator.startDrawingQuads();/* w w w . j a v a 2 s . c o m*/ { GL11.glTranslated(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.EAST)) { GL11.glRotatef(-90, 1, 0, 0); } else if (direction.equals(ForgeDirection.SOUTH)) { GL11.glRotatef(-90, 0, 0, 1); } else if (direction.equals(ForgeDirection.NORTH)) { GL11.glRotatef(90, 0, 0, 1); } else if (direction.equals(ForgeDirection.WEST)) { GL11.glRotatef(90, 1, 0, 0); } GL11.glTranslated(-0.5F, -0.5F, -0.5F); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 26 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1 - 4 * pixel, 1 - 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 1 - 11 * pixel / 2, 14 * texturePixel, 5 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1 - 4 * pixel, 11 * pixel / 2, 14 * texturePixel, 0 * texturePixel); tessellator.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * texturePixel, 0 * texturePixel); } tessellator.draw(); GL11.glTranslated(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.EAST)) { GL11.glRotatef(90, 1, 0, 0); } else if (direction.equals(ForgeDirection.SOUTH)) { GL11.glRotatef(90, 0, 0, 1); } else if (direction.equals(ForgeDirection.NORTH)) { GL11.glRotatef(-90, 0, 0, 1); } else if (direction.equals(ForgeDirection.WEST)) { GL11.glRotatef(-90, 1, 0, 0); } GL11.glTranslated(-0.5F, -0.5F, -0.5F); }
From source file:com.projectzed.mod.renderer.FluidTankRenderer.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) { GL11.glTranslated(x, y, z); GL11.glDisable(GL11.GL_LIGHTING);//from w ww . j a va 2s.c om GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 0xf0 % 65536, 0xf0 / 65536); this.bindTexture(texture); drawCuboid((TileEntityFluidTankBase) te, minVec, maxVec, (byte) 0); drawCuboid((TileEntityFluidTankBase) te, minVec, maxVec, (byte) 1); drawFluid((TileEntityFluidTankBase) te, fluidMinVec, fluidMaxVec); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glTranslated(-x, -y, -z); }
From source file:com.runescape.client.revised.editor.modelviewer.Generator.java
License:Open Source License
public void draw() { GL11.glBegin(GL11.GL_QUADS);// w w w . java 2 s .c o m for (int i = 0; i < this.particleCount; i++) { if (this.particles[i] != null) { GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, this.decParticle.getWidth(), this.decParticle.getHeight(), 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, this.bufParticle); GL11.glBindTexture(GL11.GL_ADD, GL11.GL_LOAD); GL11.glBindTexture(GL11.GL_TEXTURE_2D, 1); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); GL11.glPushMatrix(); GL11.glTranslated(this.particles[i].x + (Main.getMain().getCanvas().getX() / 2), this.particles[i].y + (Main.getMain().getCanvas().getY() / 2), 0); this.particles[i].draw(); GL11.glPopMatrix(); } } GL11.glEnd(); }
From source file:com.shinoow.abyssalcraft.client.render.block.TileEntityPSDLRenderer.java
License:Apache License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix();/*from w w w .j av a2 s . c o m*/ GL11.glTranslated(x + 0.5D, y, z + 0.75D); Minecraft.getMinecraft().renderEngine.bindTexture(Resourcelocation); model.renderAll(); GL11.glPopMatrix(); }
From source file:com.stormister.rediscovered.ModelChair.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();/* ww w . j a v a 2 s. c om*/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); back.render(scale); leg1.render(scale); leg2.render(scale); leg3.render(scale); leg4.render(scale); seat.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.stormister.rediscovered.ModelLockedChest.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();//from w w w .jav a2s . c o m GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); chestBelow.render(scale); chestLid.render(scale); chestKnob.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.stormister.rediscovered.ModelSpikes.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();/*from w w w. jav a2 s . c o m*/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); Base.render(scale); Spike1.render(scale); Spike2.render(scale); Spike3.render(scale); Spike4.render(scale); Spike5.render(scale); Spike6.render(scale); Spike7.render(scale); Spike8.render(scale); Spike9.render(scale); Spike10.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.teambr.bookshelf.client.gui.component.BaseComponent.java
License:Creative Commons License
/** * Used to draw a tooltip over this component * * @param tip The list of strings to render * @param mouseX The mouse x Position//w ww. ja v a 2 s .c om * @param mouseY The mouse Y position * @param font The font renderer */ protected void drawHoveringText(List<String> tip, int mouseX, int mouseY, FontRenderer font) { if (!tip.isEmpty()) { GL11.glPushMatrix(); GL11.glTranslated(0.0, 0.0, 5); GL11.glDisable(GL12.GL_RESCALE_NORMAL); RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); int k = 0; for (String s : tip) { int l = font.getStringWidth(s); if (l > k) { k = l; } } int j2 = mouseX + 12; int k2 = mouseY - 12; int i1 = 8; if (tip.size() > 1) { i1 += 2 + (tip.size() - 1) * 10; } if (j2 + k > parent.width) { j2 -= 28 + k; } if (k2 + i1 + 6 > parent.height) { k2 = this.getHeight() - i1 - 6; } this.zLevel = 300.0F; int j1 = -267386864; this.drawGradientRect(j2 - 3, k2 - 4, j2 + k + 3, k2 - 3, j1, j1); this.drawGradientRect(j2 - 3, k2 + i1 + 3, j2 + k + 3, k2 + i1 + 4, j1, j1); this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 + i1 + 3, j1, j1); this.drawGradientRect(j2 - 4, k2 - 3, j2 - 3, k2 + i1 + 3, j1, j1); this.drawGradientRect(j2 + k + 3, k2 - 3, j2 + k + 4, k2 + i1 + 3, j1, j1); int k1 = 1347420415; int l1 = (k1 & 16711422) >> 1 | k1 & -16777216; this.drawGradientRect(j2 - 3, k2 - 3 + 1, j2 - 3 + 1, k2 + i1 + 3 - 1, k1, l1); this.drawGradientRect(j2 + k + 2, k2 - 3 + 1, j2 + k + 3, k2 + i1 + 3 - 1, k1, l1); this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 - 3 + 1, k1, k1); this.drawGradientRect(j2 - 3, k2 + i1 + 2, j2 + k + 3, k2 + i1 + 3, l1, l1); for (String s1 : tip) { font.drawStringWithShadow(s1, j2, k2, -1); if (s1.equals(tip.get(0))) k2 += 2; k2 += 10; } this.zLevel = 0.0F; GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_DEPTH_TEST); RenderHelper.enableStandardItemLighting(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } }