Examples of Tessellator


Examples of net.minecraft.client.renderer.Tessellator

    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glTranslatef(0F, -0.525F, 0F);
    float deg = tablet.ticksExisted * 0.75F % 360F;
    GL11.glRotatef(deg, 0F, 1F, 0F);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    Tessellator tess = Tessellator.instance;
    double size1 = size / 2;
    double size2 = -size1;
    tess.startDrawingQuads();
    tess.addVertexWithUV(size2, 0, size1, 0, 1);
    tess.addVertexWithUV(size1, 0, size1, 1, 1);
    tess.addVertexWithUV(size1, 0, size2, 1, 0);
    tess.addVertexWithUV(size2, 0, size2, 0, 0);
    tess.draw();
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    }
    GL11.glTranslatef(0.5F, height, 0.5F);
    float deg = rotationMod == 0 ? forceDeg : (float) (tablet.ticksExisted * rotationMod % 360F);
    GL11.glRotatef(deg, 0F, 1F, 0F);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    Tessellator tess = Tessellator.instance;
    double size1 = size / 2;
    double size2 = -size1;
    tess.startDrawingQuads();
    tess.addVertexWithUV(size2, 0, size1, 0, 1);
    tess.addVertexWithUV(size1, 0, size1, 1, 1);
    tess.addVertexWithUV(size1, 0, size2, 1, 0);
    tess.addVertexWithUV(size2, 0, size2, 0, 0);
    tess.draw();
    GL11.glDepthMask(true);
    if (!useLighting)
      GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  @Override
  public void drawDefaultBackground() {
    int par1 = 0;
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_FOG);
    Tessellator tessellator = Tessellator.instance;
    mc.getTextureManager().bindTexture(enderField);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float f = 256.0F;
    tessellator.startDrawingQuads();
    float hue = (float) (Math.sin(ticks / 150D) + 1F / 2F);
    tessellator.setColorOpaque_I(Color.HSBtoRGB(hue, 0.5F, 0.4F));
    tessellator.addVertexWithUV(0.0D, height, 0.0D, 0.0D, height / f + par1);
    tessellator.addVertexWithUV(width, height, 0.0D, width / f, height / f + par1);
    tessellator.addVertexWithUV(width, 0.0D, 0.0D, width / f, par1);
    tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, par1);
    tessellator.draw();
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    int sy = mc.displayHeight - (maxY * sr.getScaleFactor());
    int sh = height * sr.getScaleFactor();
    GL11.glEnable(GL11.GL_SCISSOR_TEST);
    GL11.glScissor(sx, sy, sw, sh);

    Tessellator tessellator = Tessellator.instance;
    drawContainerBackground(tessellator);

    int contentYOffset = this.minY + margin - (int) this.amountScrolled;

    for (int i = 0; i < getNumElements(); ++i) {

      int elementY = contentYOffset + i * this.slotHeight;
      int slotHeight = this.slotHeight - margin;

      if(elementY <= maxY && elementY + slotHeight >= minY) {

        if(showSelectionBox && i == selectedIndex) {
          GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
          GL11.glDisable(GL11.GL_TEXTURE_2D);
          tessellator.startDrawingQuads();
          tessellator.setColorOpaque_I(8421504);
          tessellator.addVertexWithUV(minX, elementY + slotHeight + 2, 0.0D, 0.0D, 1.0D);
          tessellator.addVertexWithUV(maxX, elementY + slotHeight + 2, 0.0D, 1.0D, 1.0D);
          tessellator.addVertexWithUV(maxX, elementY - 2, 0.0D, 1.0D, 0.0D);
          tessellator.addVertexWithUV(minX, elementY - 2, 0.0D, 0.0D, 0.0D);
          tessellator.setColorOpaque_I(0);
          tessellator.addVertexWithUV(minX + 1, elementY + slotHeight + 1, 0.0D, 0.0D, 1.0D);
          tessellator.addVertexWithUV(maxX - 1, elementY + slotHeight + 1, 0.0D, 1.0D, 1.0D);
          tessellator.addVertexWithUV(maxX - 1, elementY - 1, 0.0D, 1.0D, 0.0D);
          tessellator.addVertexWithUV(minX + 1, elementY - 1, 0.0D, 0.0D, 0.0D);
          tessellator.draw();
          GL11.glEnable(GL11.GL_TEXTURE_2D);
        }

        drawElement(i, minX, elementY, slotHeight, tessellator);
      }
    }

    GL11.glDisable(GL11.GL_SCISSOR_TEST);

    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glShadeModel(GL11.GL_SMOOTH);
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    tessellator.startDrawingQuads();
    tessellator.setColorRGBA_I(0, 0);
    tessellator.addVertexWithUV(this.minX, this.minY + margin, 0.0D, 0.0D, 1.0D);
    tessellator.addVertexWithUV(this.maxX, this.minY + margin, 0.0D, 1.0D, 1.0D);
    tessellator.setColorRGBA_I(0, 255);
    tessellator.addVertexWithUV(this.maxX, this.minY, 0.0D, 1.0D, 0.0D);
    tessellator.addVertexWithUV(this.minX, this.minY, 0.0D, 0.0D, 0.0D);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA_I(0, 255);
    tessellator.addVertexWithUV(this.minX, this.maxY, 0.0D, 0.0D, 1.0D);
    tessellator.addVertexWithUV(this.maxX, this.maxY, 0.0D, 1.0D, 1.0D);
    tessellator.setColorRGBA_I(0, 0);
    tessellator.addVertexWithUV(this.maxX, this.maxY - margin, 0.0D, 1.0D, 0.0D);
    tessellator.addVertexWithUV(this.minX, this.maxY - margin, 0.0D, 0.0D, 0.0D);
    tessellator.draw();

    renderScrollBar(tessellator);

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glShadeModel(GL11.GL_FLAT);
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  }

  public static void renderQuad2D(double x, double y, double z, double width, double height, int colorRGB) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.setColorOpaque_I(colorRGB);
    tessellator.addVertex(x, y + height, z);
    tessellator.addVertex(x + width, y + height, z);
    tessellator.addVertex(x + width, y, z);
    tessellator.addVertex(x, y, z);
    tessellator.draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  }

  public static void renderQuad2D(double x, double y, double z, double width, double height, Vector4f colorRGBA) {
    GL11.glColor4f(colorRGBA.x, colorRGBA.y, colorRGBA.z, colorRGBA.w);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertex(x, y + height, z);
    tessellator.addVertex(x + width, y + height, z);
    tessellator.addVertex(x + width, y, z);
    tessellator.addVertex(x, y, z);
    tessellator.draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    lookMat.invert();
    return lookMat;
  }

  public static void renderBillboard(Matrix4d lookMat, float minU, float maxU, float minV, float maxV, double size, int brightness) {
    Tessellator tes = Tessellator.instance;
    tes.startDrawingQuads();
    tes.setBrightness(brightness);

    double s = size / 2;
    Vector3d v = new Vector3d();
    v.set(-s, s, 0);
    lookMat.transform(v);
    tes.addVertexWithUV(v.x, v.y, v.z, minU, maxV);
    v.set(s, s, 0);
    lookMat.transform(v);
    tes.addVertexWithUV(v.x, v.y, v.z, maxU, maxV);
    v.set(s, -s, 0);
    lookMat.transform(v);
    tes.addVertexWithUV(v.x, v.y, v.z, maxU, minV);
    v.set(-s, -s, 0);
    lookMat.transform(v);
    tes.addVertexWithUV(v.x, v.y, v.z, minU, minV);
    tes.draw();
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

      edges = RenderUtil.getEdgesForFace(face);
    } else {
      edges = RenderUtil.getNonConectedEdgesForFace(blockAccess, x, y, z, face);
    }

    Tessellator tes = Tessellator.instance;
    tes.setNormal(face.offsetX, face.offsetY, face.offsetZ);
    if(applyFaceShading) {
      float cm = RenderUtil.getColorMultiplierForFace(face);
      tes.setColorOpaque_F(cm, cm, cm);
    }

    float scaleFactor = 15f / 16f;
    Vector2f uv = new Vector2f();
    for (ForgeDirection edge : edges) {

      float xLen = 1 - Math.abs(edge.offsetX) * scaleFactor;
      float yLen = 1 - Math.abs(edge.offsetY) * scaleFactor;
      float zLen = 1 - Math.abs(edge.offsetZ) * scaleFactor;
      BoundingBox bb = BoundingBox.UNIT_CUBE.scale(xLen, yLen, zLen);

      List<Vector3f> corners = bb.getCornersForFace(face);

      for (Vector3f unitCorn : corners) {
        Vector3d corner = new Vector3d(unitCorn);
        if(translateToXYZ) {
          corner.x += x;
          corner.y += y;
          corner.z += z;
        }

        corner.x += (float) (edge.offsetX * 0.5) - Math.signum(edge.offsetX) * xLen / 2f;
        corner.y += (float) (edge.offsetY * 0.5) - Math.signum(edge.offsetY) * yLen / 2f;
        corner.z += (float) (edge.offsetZ * 0.5) - Math.signum(edge.offsetZ) * zLen / 2f;

        if(translateToXYZ) {
          RenderUtil.getUvForCorner(uv, corner, x, y, z, face, texture);
        } else {
          RenderUtil.getUvForCorner(uv, corner, 0, 0, 0, face, texture);
        }
        tes.addVertexWithUV(corner.x, corner.y, corner.z, uv.x, uv.y);
      }

    }

  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    drawTexturedModelRectFromIcon(x, y, zLevel, icon, width, fluidHeight);
    GL11.glDisable(GL11.GL_BLEND);
  }

  public static void drawTexturedModelRectFromIcon(double x, double y, double z, IIcon icon, double width, double height) {
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(x, y + height, z, icon.getMinU(), icon.getMaxV());
    tessellator.addVertexWithUV(x + width, y + height, z, icon.getMaxU(), icon.getMaxV());
    tessellator.addVertexWithUV(x + width, y, z, icon.getMaxU(), icon.getMinV());
    tessellator.addVertexWithUV(x, y, z, icon.getMinU(), icon.getMinV());
    tessellator.draw();
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    OpenGlHelper.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO); // stop random disappearing
   
    float width = (float) fnt.getStringWidth(toRender);
    float height = (float) fnt.FONT_HEIGHT;
    float padding = 2f;
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA_F(color.x, color.y, color.z, color.w);
    tessellator.addVertex(-padding, -padding, 0);
    tessellator.addVertex(-padding, height + padding, 0);
    tessellator.addVertex(width + padding, height + padding, 0);
    tessellator.addVertex(width + padding, -padding, 0);
    tessellator.draw();
   
    glPopAttrib();
  }
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.