List of usage examples for org.lwjgl.opengl GL11 glTranslatef
public static native void glTranslatef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);
From source file:com.minestellar.api.blocks.WireSpecialRender.java
License:Open Source License
/** * Draws the connector of a line of at least 3 wires connected to each others */// w ww . j a v a 2 s. c o m public void drawStraight(ForgeDirection direction) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); { GL11.glTranslatef(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.glTranslatef(-0.5F, -0.5F, -0.5F); { tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); if (drawInside) { tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelX); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); } } tessellator.draw(); GL11.glTranslatef(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.glTranslatef(-0.5F, -0.5F, -0.5F); } }
From source file:com.minestellar.api.blocks.WireSpecialRender.java
License:Open Source License
/** * Draws the connector with other wires adjacent to other wires *///from w w w . j a v a 2 s . c o m private void drawConnector(ForgeDirection direction) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); { GL11.glTranslatef(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.glTranslatef(-0.5F, -0.5F, -0.5F); { tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 5 * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); if (drawInside) { tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); } } tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.UP)) { // NOPE } 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.glTranslatef(-0.5F, -0.5F, -0.5F); } }
From source file:com.minestellar.api.core.WireSpecialRender.java
License:Open Source License
/** * Draws the connector of a line of at least 3 wires connected to each others *///from ww w .j a v a2 s. com public void drawStraight(ForgeDirection direction) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); { GL11.glTranslatef(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.glTranslatef(-0.5F, -0.5F, -0.5F); { tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); if (drawInside) { tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelX); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 0, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, (imageDimensionX - blockDimension - 1) * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 0, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); } } tessellator.draw(); GL11.glTranslatef(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.glTranslatef(-0.5F, -0.5F, -0.5F); } }
From source file:com.minestellar.api.core.WireSpecialRender.java
License:Open Source License
/** * Draws the connector with other wires adjacent to other wires *//*from ww w. j a va 2 s . c o m*/ private void drawConnector(ForgeDirection direction) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); { GL11.glTranslatef(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.glTranslatef(-0.5F, -0.5F, -0.5F); { tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 5 * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); if (drawInside) { tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(1 - location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(1 - location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, location * pixel / 2, blockDimension * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, location * pixel / 2, blockDimension * 2 * texturePixelX, 0); tessellator.addVertexWithUV(location * pixel / 2, 1, 1 - location * pixel / 2, blockDimension * 2 * texturePixelX, blockDimension * texturePixelY); tessellator.addVertexWithUV(location * pixel / 2, 1 - location * pixel / 2, 1 - location * pixel / 2, blockDimension * texturePixelX, blockDimension * texturePixelY); } } tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); if (direction.equals(ForgeDirection.UP)) { // NOPE } 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.glTranslatef(-0.5F, -0.5F, -0.5F); } }
From source file:com.minestellar.core.render.tile.TileEntityRenderAntenna.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ, float f) { this.bindTexture(new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/antenna.png")); GL11.glPushMatrix();//w w w .j av a2 s .c o m GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); modelAntenna.renderModel(0.0625F); // model.render(null, 0.04F, 1.0F, 1.0F, 1.0F, 1.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:com.minestellar.core.render.tile.TileEntityRenderComputer.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ, float f) { this.bindTexture(new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/computer.png")); GL11.glPushMatrix();//from w ww . j a va 2 s . c o m GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); model.renderModel(0.0625F); GL11.glPopMatrix(); }
From source file:com.minestellar.core.render.tile.TileEntityRenderGasSink.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ, float f) { texture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/gasSink.png"); this.bindTexture(texture); GL11.glPushMatrix();/*w ww . j av a2s . c om*/ GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); model.renderModel(0.0625F); // model.render(null, 0.04F, 1.0F, 1.0F, 1.0F, 1.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:com.minestellar.core.render.tile.TileEntityRenderOxygenCollector.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ, float f) { texture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/oxygenCollector.png"); this.bindTexture(texture); GL11.glPushMatrix();/*w w w.j a v a 2s . com*/ GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); model.renderModel(0.0625F); GL11.glPopMatrix(); }
From source file:com.minestellar.core.render.tile.TileEntityRenderSolarPanel.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ, float f) { texture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/solarPanel.png"); this.bindTexture(texture); GL11.glPushMatrix();/*from w w w . j a v a2 s .c o m*/ GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); model.render(null, 0.04F, 1.0F, 1.0F, 1.0F, 1.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:com.minestellar.moon.world.SkyRendererMoon.java
License:Open Source License
@Override public void render(float partialTicks, WorldClient world, Minecraft mc) { WorldProviderMoon gcProvider = null; if (world.provider instanceof WorldProviderMoon) { gcProvider = (WorldProviderMoon) world.provider; }// w ww . java 2 s. com GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor3f(1, 1, 1); final Tessellator var23 = Tessellator.instance; GL11.glDepthMask(false); GL11.glEnable(GL11.GL_FOG); GL11.glColor3f(0, 0, 0); GL11.glCallList(this.glSkyList); GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.disableStandardItemLighting(); float var10; float var11; float var12; float var20 = 0; if (gcProvider != null) { var20 = gcProvider.getStarBrightness(partialTicks); } if (var20 > 0.0F) { GL11.glColor4f(1.0F, 1.0F, 1.0F, var20); GL11.glCallList(this.starGLCallList); } GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glPushMatrix(); GL11.glPopMatrix(); GL11.glPushMatrix(); // SUN: GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 5F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); var12 = 30.0F; FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.sunTexture); var23.startDrawingQuads(); var23.addVertexWithUV(-var12, 150.0D, -var12, 0.0D, 0.0D); var23.addVertexWithUV(var12, 150.0D, -var12, 1.0D, 0.0D); var23.addVertexWithUV(var12, 150.0D, var12, 1.0D, 1.0D); var23.addVertexWithUV(-var12, 150.0D, var12, 0.0D, 1.0D); var23.draw(); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glDisable(GL11.GL_BLEND); // EARTH: var12 = 50.0F; final float earthRotation = (float) (world.getSpawnPoint().posZ - mc.thePlayer.posZ) * 0.01F; GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(earthRotation, 1.0F, 0.0F, 0.0F); GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.earthTexture); world.getMoonPhase(); var23.startDrawingQuads(); var23.addVertexWithUV(-var12, -400.0D, var12, 0, 1); var23.addVertexWithUV(var12, -400.0D, var12, 1, 1); var23.addVertexWithUV(var12, -400.0D, -var12, 1, 0); var23.addVertexWithUV(-var12, -400.0D, -var12, 0, 0); var23.draw(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_FOG); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor3f(0.0F, 0.0F, 0.0F); final double var25 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon(); if (var25 < 0.0D) { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 12.0F, 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); var10 = 1.0F; var11 = -((float) (var25 + 65.0D)); var12 = -var10; var23.startDrawingQuads(); var23.setColorRGBA_I(0, 255); var23.addVertex(-var10, var11, var10); var23.addVertex(var10, var11, var10); var23.addVertex(var10, var12, var10); var23.addVertex(-var10, var12, var10); var23.addVertex(-var10, var12, -var10); var23.addVertex(var10, var12, -var10); var23.addVertex(var10, var11, -var10); var23.addVertex(-var10, var11, -var10); var23.addVertex(var10, var12, -var10); var23.addVertex(var10, var12, var10); var23.addVertex(var10, var11, var10); var23.addVertex(var10, var11, -var10); var23.addVertex(-var10, var11, -var10); var23.addVertex(-var10, var11, var10); var23.addVertex(-var10, var12, var10); var23.addVertex(-var10, var12, -var10); var23.addVertex(-var10, var12, -var10); var23.addVertex(-var10, var12, var10); var23.addVertex(var10, var12, var10); var23.addVertex(var10, var12, -var10); var23.draw(); } GL11.glColor3f(70F / 256F, 70F / 256F, 70F / 256F); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -((float) (var25 - 16.0D)), 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(true); }