コード例 #1
0
  private void renderGlow(TileEntityBiomePainter te, float par8, int axis) {
    Tessellator v5 = Tessellator.instance;
    v5.setBrightness(240);
    int c =
        te.isInWorld()
            ? ReikaColorAPI.getModifiedHue(0xff0000, (te.getTicksExisted() * 2 + axis * 10) % 360)
            : 0xffffff;
    float r = ReikaColorAPI.getRed(c) / 255F;
    float g = ReikaColorAPI.getGreen(c) / 255F;
    float b = ReikaColorAPI.getBlue(c) / 255F;
    GL11.glColor4f(r, g, b, 1);
    GL11.glPushMatrix();
    double s = 0.5;
    GL11.glTranslated(0.5, 0, 0.5);
    GL11.glScaled(s, s, s);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    BlendMode.ADDITIVE.apply();
    double dy =
        te.isInWorld() ? 0.5 * Math.sin((te.getTicksExisted() + par8) / 12D + axis / 4D) : 0;
    if (axis >= 3) {
      dy = -dy;
    }
    double rx = 0;
    double ry = 0;
    double rz = 0;

    GL11.glPushMatrix();
    switch (axis) {
      case 0:
      case 3:
        GL11.glTranslated(0, dy, 0);
        GL11.glRotated(rx, 1, 0, 0);
        GL11.glRotated(ry, 0, 1, 0);
        GL11.glRotated(rz, 0, 0, 1);
        movingFrame.renderAll(te, null);
        break;
      case 1:
      case 4:
        GL11.glTranslated(dy, 0, 0);
        GL11.glRotated(rx, 1, 0, 0);
        GL11.glRotated(ry, 0, 1, 0);
        GL11.glRotated(rz, 0, 0, 1);
        movingFrame.renderAll(te, null);
        break;
      case 2:
      case 5:
        GL11.glTranslated(0, 0, dy);
        GL11.glRotated(rx, 1, 0, 0);
        GL11.glRotated(ry, 0, 1, 0);
        GL11.glRotated(rz, 0, 0, 1);
        movingFrame.renderAll(te, null);
        break;
    }
    GL11.glPopMatrix();

    GL11.glPopMatrix();
  }
コード例 #2
0
  private void renderInnerFrame(TileEntityBiomePainter te, float par8) {
    GL11.glPushMatrix();
    double d = 0.5;
    // double ang = te.getTicksExisted()+par8;

    if (te.isInWorld()) {
      te.angX += te.rvX;
      te.angY += te.rvY;
      te.angZ += te.rvZ;

      double v = 0.375;
      te.rvX =
          v
              * (1 + 0.5 * Math.sin(Math.toRadians(te.getTicksExisted() + par8)))
              * (1 + 0.5 * Math.cos(Math.toRadians(90 + te.getTicksExisted() + par8)));
      te.rvY =
          v
              * (1 + 0.25 * Math.sin(Math.toRadians(2 * (te.getTicksExisted() + par8))))
              * (1 + 0.5 * Math.cos(Math.toRadians(te.getTicksExisted() + par8)));
      te.rvZ =
          v
              * (1 + 0.5 * Math.sin(Math.toRadians(90 + te.getTicksExisted() + par8)))
              * (1 + 0.25 * Math.cos(Math.toRadians(2 * (te.getTicksExisted() + par8))));

      GL11.glTranslated(d, d, d);
      GL11.glRotated(te.angX, 1, 0, 0);
      GL11.glRotated(te.angY, 0, 1, 0);
      GL11.glRotated(te.angZ, 0, 0, 1);
      GL11.glTranslated(-d, -d, -d);
    }
    GL11.glTranslated(0, -0.25, 0);
    this.renderModel(te, innerFrame, this.getTextureFolder() + "biomepainterinner.png");
    GL11.glPopMatrix();
  }