Examples of Tessellator


Examples of net.minecraft.client.renderer.Tessellator

    return result;
  }

  private List<Vertex> calcFaceZPos(Block par1Block, double par2, double par4, double par6, IIcon par8Icon)
  {
    Tessellator tessellator = Tessellator.instance;

    if(this.hasOverrideBlockTexture())
    {
      par8Icon = this.overrideBlockTexture;
    }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    return result;
  }

  private List<Vertex> calcFaceXPos(Block par1Block, double par2, double par4, double par6, IIcon par8Icon)
  {
    Tessellator tessellator = Tessellator.instance;

    if(this.hasOverrideBlockTexture())
    {
      par8Icon = this.overrideBlockTexture;
    }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    float tmp = minV;
    minV = maxV;
    maxV = tmp;

    Tessellator tessellator = Tessellator.instance;

    tessellator.setNormal(0, 0, -1);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.NORTH.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    addVecWithUV(verts[1], minU, minV);
    addVecWithUV(verts[0], maxU, minV);
    addVecWithUV(verts[3], maxU, maxV);
    addVecWithUV(verts[2], minU, maxV);

    tessellator.setNormal(0, 0, 1);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.SOUTH.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    addVecWithUV(verts[4], minU, minV);
    addVecWithUV(verts[5], maxU, minV);
    addVecWithUV(verts[6], maxU, maxV);
    addVecWithUV(verts[7], minU, maxV);

    tessellator.setNormal(0, 1, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.UP.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    addVecWithUV(verts[6], minU, minV);
    addVecWithUV(verts[2], minU, maxV);
    addVecWithUV(verts[3], maxU, maxV);
    addVecWithUV(verts[7], maxU, minV);

    tessellator.setNormal(0, -1, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.DOWN.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    addVecWithUV(verts[0], maxU, maxV);
    addVecWithUV(verts[1], minU, maxV);
    addVecWithUV(verts[5], minU, minV);
    addVecWithUV(verts[4], maxU, minV);

    tessellator.setNormal(1, 0, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.EAST.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    addVecWithUV(verts[2], minU, maxV);
    addVecWithUV(verts[6], maxU, maxV);
    addVecWithUV(verts[5], maxU, minV);
    addVecWithUV(verts[1], minU, minV);

    tessellator.setNormal(-1, 0, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.WEST.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    addVecWithUV(verts[0], minU, minV);
    addVecWithUV(verts[4], maxU, minV);
    addVecWithUV(verts[7], maxU, maxV);
    addVecWithUV(verts[3], minU, maxV);
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    float maxU;
    float minV;
    float maxV;
    IIcon tex;

    Tessellator tessellator = Tessellator.instance;   

    tessellator.setNormal(0, 0, -1);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.NORTH.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }

    tex = faceTextures[ForgeDirection.NORTH.ordinal()];
    minU = tex.getMinU();
    maxU = tex.getMaxU();
    minV = tex.getMinV();
    maxV = tex.getMaxV();
    addVecWithUV(verts[1], minU, maxV);
    addVecWithUV(verts[0], maxU, maxV);
    addVecWithUV(verts[3], maxU, minV);
    addVecWithUV(verts[2], minU, minV);

    tessellator.setNormal(0, 0, 1);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.SOUTH.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    tex = faceTextures[ForgeDirection.SOUTH.ordinal()];
    minU = tex.getMinU();
    maxU = tex.getMaxU();
    minV = tex.getMinV();
    maxV = tex.getMaxV();
    addVecWithUV(verts[4], minU, maxV);
    addVecWithUV(verts[5], maxU, maxV);
    addVecWithUV(verts[6], maxU, minV);
    addVecWithUV(verts[7], minU, minV);

    tessellator.setNormal(0, 1, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.UP.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    tex = faceTextures[ForgeDirection.UP.ordinal()];
    minU = tex.getMinU();
    maxU = tex.getMaxU();
    minV = tex.getMinV();
    maxV = tex.getMaxV();
    addVecWithUV(verts[6], minU, minV);
    addVecWithUV(verts[2], minU, maxV);
    addVecWithUV(verts[3], maxU, maxV);
    addVecWithUV(verts[7], maxU, minV);

    tessellator.setNormal(0, -1, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.DOWN.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    tex = faceTextures[ForgeDirection.DOWN.ordinal()];
    minU = tex.getMinU();
    maxU = tex.getMaxU();
    minV = tex.getMinV();
    maxV = tex.getMaxV();
    addVecWithUV(verts[0], maxU, maxV);
    addVecWithUV(verts[1], minU, maxV);
    addVecWithUV(verts[5], minU, minV);
    addVecWithUV(verts[4], maxU, minV);

    tessellator.setNormal(1, 0, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.EAST.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    tex = faceTextures[ForgeDirection.EAST.ordinal()];
    minU = tex.getMinU();
    maxU = tex.getMaxU();
    minV = tex.getMinV();
    maxV = tex.getMaxV();
    addVecWithUV(verts[2], minU, minV);
    addVecWithUV(verts[6], maxU, minV);
    addVecWithUV(verts[5], maxU, maxV);
    addVecWithUV(verts[1], minU, maxV);

    tessellator.setNormal(-1, 0, 0);
    if(brightnessPerSide != null) {
      float cm = brightnessPerSide[ForgeDirection.WEST.ordinal()];
      tessellator.setColorOpaque_F(cm, cm, cm);
    }
    tex = faceTextures[ForgeDirection.WEST.ordinal()];
    minU = tex.getMinU();
    maxU = tex.getMaxU();
    minV = tex.getMinV();
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

        rightMouseDown = Mouse.getEventButton() == 1 && Mouse.getEventButtonState();
      } else {
        rightMouseDown = false;
      }
     
      Tessellator tes = Tessellator.instance;
      tes.startDrawingQuads();

      int x = xPosition + 2;
      int y = yPosition + 2;

      GL11.glDisable(GL11.GL_TEXTURE_2D);

      int col = ItemDye.field_150922_c[colorIndex];
      tes.setColorOpaque_I(col);
      tes.addVertex(x, y + height - 4, zLevel);
      tes.addVertex(x + width - 4, y + height - 4, zLevel);
      tes.addVertex(x + width - 4, y + 0, zLevel);
      tes.addVertex(x, y + 0, zLevel);

      tes.draw();

      GL11.glEnable(GL11.GL_TEXTURE_2D);

    }
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  private Vector3d left = new Vector3d();
  private Vector3d up = new Vector3d();
  private Vector3d offset = new Vector3d();

  private void drawSwitch(ForgeDirection dir, BoundingBox bb) {
    Tessellator tes = Tessellator.instance;

    Vector3d cent = bb.getCenter();
    offset.set(cent);

    boolean isUp = dir.offsetY != 0;

    if(dir == ForgeDirection.UP) {
      int i = 0;
    }

    forward.set(dir.offsetX, dir.offsetY, dir.offsetZ);
    forward.scale(0.5);
    forward.x *= bb.sizeX();
    forward.y *= bb.sizeY();
    forward.z *= bb.sizeZ();

    offset.add(forward);

    if(dir.offsetY == 0) {
      offset.y += bb.sizeY() * 0.25;
    }
    if(dir.offsetX == 0) {
      offset.x -= (isUp ? dir.offsetY : dir.offsetZ) * bb.sizeX() * 0.25;
    }
    if(dir.offsetZ == 0) {
      offset.z += (isUp ? -dir.offsetY : dir.offsetX) * bb.sizeZ() * 0.25;
    }

    left.set(isUp ? -dir.offsetY : -dir.offsetZ, 0, dir.offsetX);

    if(isUp) {
      up.set(0, 0, -1);
    } else {
      up.set(0, 1, 0);
    }

    forward.scale(0.5);
    left.scale(0.125);
    up.scale(0.125);

    IIcon icon = block.switchIcon;

    tes.addVertexWithUV(offset.x + left.x - up.x, offset.y + left.y - up.y,
        offset.z + left.z - up.z, icon.getMinU(), icon.getMaxV());
    tes.addVertexWithUV(offset.x - left.x - up.x, offset.y - left.y - up.y,
        offset.z - left.z - up.z, icon.getMaxU(), icon.getMaxV());
    tes.addVertexWithUV(offset.x - left.x + up.x, offset.y - left.y + up.y,
        offset.z - left.z + up.z, icon.getMaxU(), icon.getMinV());
    tes.addVertexWithUV(offset.x + left.x + up.x, offset.y + left.y + up.y,
        offset.z + left.z + up.z, icon.getMinU(), icon.getMinV());

  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

      IconEIO background = getIconForHoverState(hoverState);

      RenderUtil.bindTexture(texture);
      GL11.glColor3f(1, 1, 1);

      Tessellator tes = Tessellator.instance;
      tes.startDrawingQuads();

      int x = xPosition;
      int y = yPosition;

      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

      background.renderIcon(x, y, width, height, 0, false);
      if(icon != null) {
        icon.renderIcon(x + marginX, y + marginY, width - (2 * marginX), height - (2 * marginY), 0, false);
      }

      tes.draw();

      GL11.glPopAttrib();

    }
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

      return;
    }
    IIcon icon = tank.getFluid().getFluid().getStillIcon();
    if(icon != null) {
      RenderUtil.bindBlockTexture();
      Tessellator tes = Tessellator.instance;
      tes.startDrawingQuads();

      float fullness = (float) (tank.getFluidAmount()) / (tank.getCapacity());
      BoundingBox bb = BoundingBox.UNIT_CUBE.scale(0.85, 0.96, 0.85);
      bb = bb.scale(1, 0.85 * fullness, 1);
      float ty = -(0.85f - (bb.maxY - bb.minY)) / 2;

      Vector3d offset = ForgeDirectionOffsets.offsetScaled(ForgeDirection.values()[gen.facing], -0.075);
      bb = bb.translate((float) offset.x, ty, (float) offset.z);

      int brightness;
      if(gen.getWorldObj() == null) {
        brightness = 15 << 20 | 15 << 4;
      } else {
        brightness = gen.getWorldObj().getLightBrightnessForSkyBlocks(gen.xCoord, gen.yCoord, gen.zCoord, 0);
      }
      tes.setBrightness(brightness);
      tes.setColorOpaque_F(1, 1, 1);

      CubeRenderer.render(bb, icon);

      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glDisable(GL11.GL_LIGHTING);    
      GL11.glDepthMask(false);
      GL11.glColor3f(1, 1, 1);     
     
      tes.draw();
      GL11.glDepthMask(true);
      GL11.glPopAttrib();
    }
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    IIcon icon = Blocks.portal.getBlockTextureFromSide(1);
    float f1 = icon.getMinU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxU();
    float f4 = icon.getMaxV();
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(0.0D, par3, -90.0D, f1, f4);
    tessellator.addVertexWithUV(par2, par3, -90.0D, f3, f4);
    tessellator.addVertexWithUV(par2, 0.0D, -90.0D, f3, f2);
    tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, f1, f2);
    tessellator.draw();
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    renderIcon(x, y, width, height, zLevel, doDraw, false);
  }

  public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw, boolean flipY) {

    Tessellator tessellator = Tessellator.instance;
    if(doDraw) {
      RenderUtil.bindTexture(TEXTURE);
      tessellator.startDrawingQuads();
    }
    if(flipY) {
      tessellator.addVertexWithUV(x, y + height, zLevel, minU, minV);
      tessellator.addVertexWithUV(x + width, y + height, zLevel, maxU, minV);
      tessellator.addVertexWithUV(x + width, y + 0, zLevel, maxU, maxV);
      tessellator.addVertexWithUV(x, y + 0, zLevel, minU, maxV);
    } else {
      tessellator.addVertexWithUV(x, y + height, zLevel, minU, maxV);
      tessellator.addVertexWithUV(x + width, y + height, zLevel, maxU, maxV);
      tessellator.addVertexWithUV(x + width, y + 0, zLevel, maxU, minV);
      tessellator.addVertexWithUV(x, y + 0, zLevel, minU, minV);
    }
    if(doDraw) {
      tessellator.draw();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.