Java Code Examples for net.minecraft.client.renderer.Tessellator#setNormal()
The following examples show how to use
net.minecraft.client.renderer.Tessellator#setNormal() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LingeringPotionRenderer.java From Et-Futurum with The Unlicense | 6 votes |
private void renderIcon(IIcon icon) { Tessellator tessellator = Tessellator.instance; float minU = icon.getMinU(); float maxU = icon.getMaxU(); float minV = icon.getMinV(); float maxV = icon.getMaxV(); OpenGLHelper.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); OpenGLHelper.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(-0.5F, -0.25F, 0.0D, minU, maxV); tessellator.addVertexWithUV(0.5F, -0.25F, 0.0D, maxU, maxV); tessellator.addVertexWithUV(0.5F, 0.75F, 0.0D, maxU, minV); tessellator.addVertexWithUV(-0.5F, 0.75F, 0.0D, minU, minV); tessellator.draw(); }
Example 2
Source File: BlockChorusFlowerRender.java From Et-Futurum with The Unlicense | 6 votes |
private void renderCube(RenderBlocks renderer, Block block, int meta) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta)); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta)); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta)); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta)); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta)); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta)); tessellator.draw(); }
Example 3
Source File: RenderAutoChisel.java From Chisel-2 with GNU General Public License v2.0 | 6 votes |
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { Tessellator tes = Tessellator.instance; IIcon icon = renderer.hasOverrideBlockTexture() ? renderer.overrideBlockTexture : block.getIcon(0, 0); tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); tes.setColorOpaque_F(1, 1, 1); tes.addTranslation(x, y, z + 1); for (GroupObject go : model.groupObjects) { for (Face f : go.faces) { Vertex n = f.faceNormal; tes.setNormal(n.x, n.y, n.z); for (int i = 0; i < f.vertices.length; i++) { Vertex vert = f.vertices[i]; TextureCoordinate t = f.textureCoordinates[i]; if (!renderer.hasOverrideBlockTexture()) { tes.addVertexWithUV(vert.x, vert.y, vert.z, icon.getInterpolatedU(t.u * 16), icon.getInterpolatedV(t.v * 16)); } else { tes.addVertexWithUV(vert.x, vert.y, vert.z, icon.getInterpolatedU((t.u * 64) % 16), icon.getInterpolatedV((t.v * 64) % 16)); } } } } tes.addTranslation(-x, -y, -z - 1); return true; }
Example 4
Source File: ModelCertusTank.java From ExtraCells1 with MIT License | 5 votes |
public void renderInnerBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) { Tessellator tessellator = Tessellator.instance; boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank; boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank; int meta = 0; if (tankUp && tankDown) meta = 3; else if (tankUp) meta = 2; else if (tankDown) meta = 1; if (!tankDown) { tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(block, x, y + 0.001D, z, block.getIcon(0, 0)); } if (!(tankUp)) { tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y - 0.001D, z, block.getIcon(1, 0)); } Icon sideIcon = block.getIcon(3, meta); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(block, x, y, z + 0.001D, sideIcon); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z - 0.001D, sideIcon); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x + 0.001D, y, z, sideIcon); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x - 0.001D, y, z, sideIcon); }
Example 5
Source File: RenderTargetCircle.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
public void render(double size, float partialTicks){ double renderRotationAngle = oldRotationAngle + (rotationAngle - oldRotationAngle) * partialTicks; Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); // GL11.glLineWidth((float)size * 20F); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glRotatef((float)renderRotationAngle, 0, 0, 1); tessellator.setNormal(0F, 1F, 0F); for(int j = 0; j < 2; j++) { tessellator.startDrawing(GL11.GL_TRIANGLE_STRIP); for(int i = 0; i < PneumaticCraftUtils.circlePoints / 4; i++) { tessellator.addVertex(PneumaticCraftUtils.cos[i] * size, PneumaticCraftUtils.sin[i] * size, 0); tessellator.addVertex(PneumaticCraftUtils.cos[i] * (size + 0.1D), PneumaticCraftUtils.sin[i] * (size + 0.1D), 0); } tessellator.draw(); if(renderAsTagged) { GL11.glColor4d(1, 0, 0, 1); tessellator.startDrawing(GL11.GL_LINE_LOOP); for(int i = 0; i < PneumaticCraftUtils.circlePoints / 4; i++) { tessellator.addVertex(PneumaticCraftUtils.cos[i] * size, PneumaticCraftUtils.sin[i] * size, 0); } for(int i = PneumaticCraftUtils.circlePoints / 4 - 1; i >= 0; i--) { tessellator.addVertex(PneumaticCraftUtils.cos[i] * (size + 0.1D), PneumaticCraftUtils.sin[i] * (size + 0.1D), 0); } tessellator.draw(); GL11.glColor4d(1, 1, 0, 0.5); } GL11.glRotatef(180, 0, 0, 1); } GL11.glDisable(GL11.GL_LINE_SMOOTH); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
Example 6
Source File: SimpleRendererFuelRod.java From BigReactors with MIT License | 5 votes |
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 7
Source File: Drawing.java From Chisel with GNU General Public License v2.0 | 5 votes |
public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); }
Example 8
Source File: SemiBlockRendererLogistics.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
public static void renderOffsetAABB(AxisAlignedBB p_76978_0_, double p_76978_1_, double p_76978_3_, double p_76978_5_){ Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setTranslation(p_76978_1_, p_76978_3_, p_76978_5_); tessellator.setNormal(0.0F, 0.0F, -1.0F); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ); tessellator.setNormal(0.0F, 0.0F, 1.0F); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ); tessellator.setNormal(-1.0F, 0.0F, 0.0F); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ); tessellator.setNormal(1.0F, 0.0F, 0.0F); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ); tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ); tessellator.setTranslation(0.0D, 0.0D, 0.0D); tessellator.draw(); }
Example 9
Source File: RenderHelper.java From GardenCollection with MIT License | 5 votes |
private void setupColorMult (int face, float r, float g, float b) { Tessellator tessellator = Tessellator.instance; float[] norm = normMap[face]; float scale = state.getColorMult(face); tessellator.setColorOpaque_F(scale * r, scale * g, scale * b); tessellator.startDrawingQuads(); tessellator.setNormal(norm[0], norm[1], norm[2]); state.enableAO = false; }
Example 10
Source File: ModelCertusTank.java From ExtraCells1 with MIT License | 5 votes |
public void renderOuterBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) { Tessellator tessellator = Tessellator.instance; boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank; boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank; int meta = 0; if (tankUp && tankDown) meta = 3; else if (tankUp) meta = 2; else if (tankDown) meta = 1; if (!tankDown) { tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0)); } if (!(tankUp)) { tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 0)); } Icon sideIcon = block.getIcon(3, meta); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(block, x, y, z, sideIcon); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z, sideIcon); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x, y, z, sideIcon); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x, y, z, sideIcon); }
Example 11
Source File: ThinLogFenceRenderer.java From GardenCollection with MIT License | 5 votes |
private void renderSideAtOrigin (BlockThinLogFence block, int metadata, RenderBlocks renderer, Tessellator tessellator, float xs, float xe) { tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.setRenderBounds(xs, 0, 0, xe, 1, 1); renderer.renderFaceZNeg(block, 0, 0, .5f, block.getSideIcon()); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.setRenderBounds(xs, 0, 0, xe, 1, 1); renderer.renderFaceZPos(block, 0, 0, -.5f, block.getSideIcon()); tessellator.draw(); }
Example 12
Source File: ThinLogRenderer.java From GardenCollection with MIT License | 5 votes |
@Override public void renderInventoryBlock (Block block, int metadata, int modelId, RenderBlocks renderer) { block.setBlockBoundsForItemRender(); renderer.setRenderBoundsFromBlock(block); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 13
Source File: RendererGlasBlock.java From bartworks with MIT License | 5 votes |
@Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; block.setBlockBoundsForItemRender(); renderer.setRenderBoundsFromBlock(block); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 14
Source File: ModelCertusTank.java From ExtraCells1 with MIT License | 5 votes |
public void renderFluid(TileEntity tileEntity, double x, double y, double z, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; tessellator.setColorOpaque(255, 255, 255); if (tileEntity != null && ((TileEntityCertusTank) tileEntity).getTankInfo(ForgeDirection.UNKNOWN)[0].fluid != null) { Fluid storedFluid = ((TileEntityCertusTank) tileEntity).getRenderFluid(); float scale = ((TileEntityCertusTank) tileEntity).getRenderScale(); if (storedFluid != null && scale > 0) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Block id = Block.blocksList[FluidRegistry.WATER.getBlockID()]; Icon fluidIcon = storedFluid.getIcon(); if (fluidIcon == null) fluidIcon = FluidRegistry.LAVA.getIcon(); renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, scale * 0.999F, 0.92F); tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(id, x, y, z, fluidIcon); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(id, x, y, z, fluidIcon); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(id, x, y, z, fluidIcon); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(id, x, y, z, fluidIcon); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(id, x, y, z, fluidIcon); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(id, x, y, z, fluidIcon); } } }
Example 15
Source File: BlockExtendedNodeJarRenderer.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
public static void drawFaces(RenderBlocks renderblocks, Block block, IIcon i1, IIcon i2, IIcon i3, IIcon i4, IIcon i5, IIcon i6, boolean solidtop) { Tessellator tessellator = Tessellator.instance; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, i1); tessellator.draw(); if (solidtop) { GL11.glDisable(3008); } tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, i2); tessellator.draw(); if (solidtop) { GL11.glEnable(3008); } tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, i3); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, i4); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, i5); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, i6); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 16
Source File: TileEntityEndRodRenderer.java From Et-Futurum with The Unlicense | 4 votes |
public static void renderRod(RenderBlocks renderer, Block block, int meta) { Tessellator tessellator = Tessellator.instance; double x = 7 / 16.0; double y = 0; double z = 7 / 16.0; renderer.setRenderBounds(0, 1 / 16F, 0, 2 / 16F, 1, 2 / 16F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta)); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta)); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta)); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta)); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta)); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta)); tessellator.draw(); x = 4 / 16.0; y = 0; z = 4 / 16.0; renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 6 / 16F, 1 / 16F, 6 / 16F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta)); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta)); y = -13 / 16.0; renderer.setRenderBounds(2 / 16F, 13 / 16F, 2 / 16F, 6 / 16F, 14 / 16F, 6 / 16F); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta)); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta)); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta)); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta)); tessellator.draw(); }
Example 17
Source File: ItemRendererCertusTank.java From ExtraCells1 with MIT License | 4 votes |
public void renderItem(ItemRenderType type, ItemStack item, Object... data) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("extracells", "textures/blocks/texmap_tank.png")); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); GL11.glScalef(1.0F, -1F, -1F); model.render(0.0625f); GL11.glScalef(1.0F, -1F, 1.0F); model.render(0.0625f); if (item != null && item.hasTagCompound()) { FluidStack storedFluid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("tileEntity")); int tankCapacity = 32000; if (storedFluid != null && storedFluid.getFluid() != null) { Icon fluidIcon = storedFluid.getFluid().getIcon(); Tessellator tessellator = Tessellator.instance; RenderBlocks renderer = new RenderBlocks(); GL11.glScalef(1.0F, 1.0F, -1.0F); renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, (float) storedFluid.amount / (float) tankCapacity * 0.999F, 0.92F); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); GL11.glPopAttrib(); } } GL11.glPopMatrix(); }
Example 18
Source File: RenderBlockSeat.java From archimedes-ships with MIT License | 4 votes |
@Override public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { Tessellator tess = Tessellator.instance; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tess.startDrawingQuads(); tess.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 0)); tess.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 1)); tess.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 5)); tess.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 2)); tess.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 3)); tess.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 4)); tess.draw(); renderer.setRenderBounds(0F, block.getBlockBoundsMaxY(), 0F, 1F, 1F, 0.2F); tess.startDrawingQuads(); tess.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 0)); tess.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 1)); tess.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 5)); tess.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 2)); tess.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 3)); tess.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 4)); tess.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); /* renderer.renderAllFaces = true; renderer.setRenderBounds(0D, 0D, 0D, 1D, 0.5D, 1D); renderer.renderStandardBlock(block, 0, 0, 0); if (meta == 0) { renderer.setRenderBounds(0D, 0D, 0D, 0.2D, 1D, 1D); } else if (meta == 1) { } else if (meta == 2) { renderer.setRenderBounds(0.8D, 0D, 0D, 1D, 1D, 1D); } else if (meta == 3) { } //renderer.renderStandardBlock(block, x, y, z); renderer.renderAllFaces = false; */ }
Example 19
Source File: RenderTileStickyJar.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) { if(tile != null && tile instanceof TileStickyJar && ((TileStickyJar) tile).isValid()) { TileStickyJar stickyJar = (TileStickyJar) tile; TileJarFillable parent = stickyJar.getParent(); World world = tile.getWorldObj(); Block block = stickyJar.getParentBlock(); GL11.glPushMatrix(); GL11.glTranslated(x, y, z); rotateJar(stickyJar.placedOn, ForgeDirection.getOrientation(stickyJar.facing)); //TESR TileEntitySpecialRenderer renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(parent); if(renderer != null) { stickyJar.syncToParent(); renderer.renderTileEntityAt(parent, 0, 0, 0, partialTicks); stickyJar.syncFromParent(); } //ISimpleBlockHandler GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); bindTexture(TextureMap.locationBlocksTexture); RENDER_BLOCKS.blockAccess = world; Tessellator tess = Tessellator.instance; tess.startDrawingQuads(); tess.setNormal(0, -stickyJar.placedOn.offsetY, -Math.abs(stickyJar.placedOn.offsetZ + stickyJar.placedOn.offsetX)); tess.setTranslation(-tile.xCoord, -tile.yCoord, -tile.zCoord); RENDER_BLOCKS.renderBlockByRenderType(block, tile.xCoord, tile.yCoord, tile.zCoord); tess.setTranslation(0, 0, 0); tess.draw(); GL11.glPopAttrib(); GL11.glPopMatrix(); GL11.glPopMatrix(); } }
Example 20
Source File: FXVortex.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
private void render(Tessellator tessellator, float pTicks) { float arX = ActiveRenderInfo.rotationX; float arXZ = ActiveRenderInfo.rotationXZ; float arZ = ActiveRenderInfo.rotationZ; float arYZ = ActiveRenderInfo.rotationYZ; float arXY = ActiveRenderInfo.rotationXY; GL11.glPushMatrix(); GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float agescale = (float) (ClientHandler.ticks % 800) / 400F; if(agescale >= 1.0F) agescale = 2 - agescale; float size = 0.2F + 0.1F * agescale; if(parent != null) { size += size * (((float) parent.getSizeStage()) * 0.04F); } float anglePerc = (float) (ClientHandler.ticks % 300) / 300F; float angle = RAD - RAD * anglePerc; Vector3 iV = MiscUtils.interpolateEntityPosition(Minecraft.getMinecraft().renderViewEntity, pTicks); if(parent != null && parent.getSizeStage() > 4) { float mult = 0.001F * (parent.getSizeStage() - 4F); Vector3 shake = new Vector3( RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1), RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1), RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1)); iV.add(shake); } GL11.glTranslated(-iV.getX(), -iV.getY(), -iV.getZ()); UtilsFX.bindTexture(TC_VORTEX_TEXTURE); tessellator.startDrawingQuads(); tessellator.setBrightness(220); tessellator.setColorRGBA_F(1F, 1F, 1F, 1F); Vec3 v1 = Vec3.createVectorHelper(-arX * size - arYZ * size, -arXZ * size, -arZ * size - arXY * size); Vec3 v2 = Vec3.createVectorHelper(-arX * size + arYZ * size, arXZ * size, -arZ * size + arXY * size); Vec3 v3 = Vec3.createVectorHelper(arX * size + arYZ * size, arXZ * size, arZ * size + arXY * size); Vec3 v4 = Vec3.createVectorHelper(arX * size - arYZ * size, -arXZ * size, arZ * size - arXY * size); if (angle != 0.0F) { Vec3 pvec = Vec3.createVectorHelper(iV.getX(), iV.getY(), iV.getZ()); Vec3 tvec = Vec3.createVectorHelper(x, y, z); Vec3 qvec = pvec.subtract(tvec).normalize(); QuadHelper.setAxis(qvec, angle).rotate(v1); QuadHelper.setAxis(qvec, angle).rotate(v2); QuadHelper.setAxis(qvec, angle).rotate(v3); QuadHelper.setAxis(qvec, angle).rotate(v4); } tessellator.setNormal(0.0F, 0.0F, -1.0F); tessellator.addVertexWithUV(x + v1.xCoord, y + v1.yCoord, z + v1.zCoord, 0, 1); tessellator.addVertexWithUV(x + v2.xCoord, y + v2.yCoord, z + v2.zCoord, 1, 1); tessellator.addVertexWithUV(x + v3.xCoord, y + v3.yCoord, z + v3.zCoord, 1, 0); tessellator.addVertexWithUV(x + v4.xCoord, y + v4.yCoord, z + v4.zCoord, 0, 0); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glPopMatrix(); }