@Override
  public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) {
    TileEntityCustomizeableDecoration tile = (TileEntityCustomizeableDecoration) tileEntity;
    RenderElement[] renderElements = tile.getRenderElements();

    GL11.glPushMatrix();
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    GL11.glTranslated(x, y, z);
    for (RenderElement element : renderElements) {
      if (element != null) {
        try {
          //					if(!GraphicUtilities.isModelPathValid(element.getModel())
          //						/*||*/if(	!GraphicUtilities.isTexturePathValid(element.getTexture()) )
          //						break;
          GL11.glPushMatrix();

          GraphicUtilities.bindTexture(element.getTexture());
          GL11.glColor4d(
              element.getColour()[0],
              element.getColour()[1],
              element.getColour()[2],
              element.getAlpha());
          GL11.glTranslated(0.5, 0.5, 0.5);
          GL11.glRotated(tile.getOrientation(), 0, 1, 0);
          GL11.glTranslated(-0.5, -0.5, -0.5);
          GL11.glTranslated(
              element.getTranslation()[0],
              element.getTranslation()[1],
              element.getTranslation()[2]);

          if (element.getRotation()[2] != 0) GL11.glRotated(element.getRotation()[2], 0, 0, 1);
          if (element.getRotation()[1] != 0) GL11.glRotated(element.getRotation()[1], 0, 1, 0);
          if (element.getRotation()[0] != 0) GL11.glRotated(element.getRotation()[0], 1, 0, 0);

          GL11.glScaled(tile.getScale(), tile.getScale(), tile.getScale());
          if (GraphicUtilities.isModelPathValid(element.getModel())) {
            IModelCustom tempMod = GraphicUtilities.bindModel(element.getModel());
            if (tempMod != null && GraphicUtilities.isModelPartValid(tempMod, element.getPart()))
              tempMod.renderPart(element.getPart());
          }
          GL11.glPopMatrix();
        } catch (Exception except) {
          // except.printStackTrace();
          GL11.glPopMatrix();
        }
      }
    }

    GL11.glDisable(3042);
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glPopMatrix();
  }
コード例 #2
0
 @Override
 public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float var8) {
   IModelCustom model = APClientProps.MDL_MAGNET_MODULE;
   int meta = var1.getBlockMetadata();
   GL11.glPushMatrix();
   {
     RenderUtils.loadTexture(APClientProps.TEX_MDL_MAGNET_MODULE);
     GL11.glTranslated(x, y, z);
     float scale = 0.0036F;
     GL11.glTranslatef(0.5F, 0.0F, 0.5F);
     GL11.glRotatef(rotations[meta], 0F, -1F, 0F);
     GL11.glScalef(scale, scale, scale);
     model.renderAll();
   }
   GL11.glPopMatrix();
 }
コード例 #3
0
ファイル: ModelPal.java プロジェクト: vdvman1/pal
 public void render(TilePal pal, double x, double y, double z) {
   GL11.glPushMatrix();
   GL11.glTranslatef((float) x + 0.5f, (float) y + 0.5f, (float) z + 0.5f);
   GL11.glScalef(0.5f, 0.5f, 0.5f);
   FMLClientHandler.instance()
       .getClient()
       .renderEngine
       .bindTexture(new ResourceLocation("pal:models/pal.png"));
   modelPal.renderPart("Center");
   for (int i = 0; i < 6; i++) {
     if (pal.isSideActive(i)) {
       modelPal.renderPart(sideToModelPart[i] + (pal.isSideOn(i) ? "_on" : "_off"));
     }
   }
   GL11.glPopMatrix();
 }
コード例 #4
0
ファイル: HyperCubeModel.java プロジェクト: nevercast/EnderIO
 @Override
 public void render() {
   GL11.glPushMatrix();
   GL11.glScalef(SCALE, SCALE, SCALE);
   RenderUtil.bindTexture(TEXTURE);
   model.renderAll();
   GL11.glPopMatrix();
 }
コード例 #5
0
  public void renderAll(boolean mirror, float doorAngle) {

    model.renderPart("box");

    if (doorAngle > 0) {
      float rotatePointX = (mirror ? -7 : 7);
      float rotatePointZ = -7;
      if (mirror) doorAngle = -doorAngle;

      GL11.glTranslated(-rotatePointX, 0, -rotatePointZ);
      GL11.glRotatef(-doorAngle, 0, 1, 0);
      GL11.glTranslated(rotatePointX, 0, rotatePointZ);
    }
    model.renderPart("door");

    if (mirror) GL11.glTranslated(-11, 0, 0);
    model.renderPart("handle");
  }
コード例 #6
0
 @Override
 public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) {
   bindTexture(blockTexture);
   GL11.glPushMatrix();
   GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
   GL11.glScaled(scale, scale, scale);
   block.renderAll();
   GL11.glPopMatrix();
 }
コード例 #7
0
  public void renderStabilizerSphere(TileParticleGenerator tile) {
    GL11.glPushMatrix();
    // GL11.glColor4f(0.5F, 0.0F, 0.0F, 1F);
    GL11.glColor4f(0.0F, 2.0F, 0.0F, 1F);
    GL11.glTranslated(0.5, 0, 0.5);
    GL11.glScalef(0.4F, 0.4F, 0.4F);
    if (!tile.stabalizerMode) {
      float red = (float) tile.beam_red / 255F;
      float green = (float) tile.beam_green / 255F;
      float blue = (float) tile.beam_blue / 255F;
      GL11.glColor4f(red, green, blue, 1F);
      GL11.glScalef(tile.beam_scale, tile.beam_scale, tile.beam_scale);
    }

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);

    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(modelTexture);

    GL11.glRotatef(tile.rotation, 0F, 1F, 0F);
    stabilizerSphereModel.renderAll();

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200);
    GL11.glRotatef(tile.rotation * 2, 0F, -1F, 0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDepthMask(false);
    GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F);
    if (!tile.stabalizerMode) {
      float red = (float) tile.beam_red / 255F;
      float green = (float) tile.beam_green / 255F;
      float blue = (float) tile.beam_blue / 255F;
      GL11.glColor4f(red, green, blue, 0.5F);
    }
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glScalef(1.3F, 1.3F, 1.3F);
    stabilizerSphereModel.renderAll();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);

    GL11.glPopMatrix();
  }
コード例 #8
0
ファイル: ModelOBJWrapper.java プロジェクト: uzzaco2002/secri
  public void render(float scale) {
    GL11.glPushMatrix();
    GL11.glScalef(scale, scale, scale);
    GL11.glRotatef(90, 1, 0, 0);
    GL11.glTranslatef(
        offsetX, offsetZ, offsetY); // Z comes before Y because we are rotating by 90 first

    model.renderAll();
    GL11.glPopMatrix();
  }
コード例 #9
0
 @Override
 public void renderTileEntityAt(
     TileEntity te, double posX, double posY, double posZ, float timeSinceLastTick) {
   TileVirtualisationScanner te2 = (TileVirtualisationScanner) te;
   if (ifrender(te2)) {
     float rotation = te2.rotation + (timeSinceLastTick / 2F);
     float scale = te2.scale;
     bindTexture(texture);
     GL11.glPushMatrix();
     GL11.glTranslated(posX + 0.5, posY + 0.5, posZ + 0.5);
     //			GL11.glScalef(scale, scale, scale);
     GL11.glPushMatrix();
     //			GL11.glRotatef(rotation, 0F, 0F, 0F);
     model.renderAll();
     GL11.glPopMatrix();
     GL11.glPopMatrix();
   }
 }
  @Override
  public void renderDynamic(TileEntity tile, double x, double y, double z, float f) {
    super.renderDynamic(tile, x, y, z, f);

    if (tile instanceof TileRedstoneWireConnector) {
      GL11.glPushMatrix();

      int hex = ItemDye.field_150922_c[15 - ((TileRedstoneWireConnector) tile).redstoneChannel];
      int r = (hex & 0xFF0000) >> 16;
      int g = (hex & 0xFF00) >> 8;
      int b = (hex & 0xFF);

      GL11.glColor3f(r / 255f, g / 255f, b / 255f);
      GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);

      if (tile.hasWorldObj()) {
        switch (tile.getBlockMetadata()) {
          case 0:
            break;
          case 1:
            GL11.glRotatef(180, 0, 0, 1);
            break;
          case 2:
            GL11.glRotatef(90, 1, 0, 0);
            break;
          case 3:
            GL11.glRotatef(-90, 1, 0, 0);
            break;
          case 4:
            GL11.glRotatef(-90, 0, 0, 1);
            break;
          case 5:
            GL11.glRotatef(90, 0, 0, 1);
            break;
        }
      }

      Minecraft.getMinecraft().renderEngine.bindTexture(channelTexture);
      modelChannel.renderAll();
      GL11.glPopMatrix();
    }
  }
コード例 #11
0
ファイル: ModelTableSaw.java プロジェクト: GeoDoX/GeoCraft
 public void render() {
   tableSaw.renderAll();
 }
 public void render() {
   modelResearchStation.renderAll();
 }
コード例 #13
0
  @Override
  public void renderTileEntityAt(
      TileEntity tile, double x, double y, double z, float timeSinceLastTick) {
    if (tile == null || !(tile instanceof TileEnergyStorageCore)) return;
    TileEnergyStorageCore core = (TileEnergyStorageCore) tile;
    if (!core.isOnline()) return;
    float scale = 0;
    float rotation = core.modelRotation + (timeSinceLastTick / 2F);

    switch (core.getTier()) {
      case 0:
        scale = 0.7F;
        break;
      case 1:
        scale = 1.2F;
        break;
      case 2:
        scale = 1.7F;
        break;
      case 3:
        scale = 2.5F;
        break;
      case 4:
        scale = 3.5F;
        break;
      case 5:
        scale = 4.5F;
        break;
      case 6:
        scale = 5.5F;
        break;
    }

    GL11.glPushMatrix();
    GL11.glColor4f(1F, 1F, 1F, 1F);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 150f, 150f);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture);

    double colour =
        (double) ((TileEnergyStorageCore) tile).getEnergyStored()
            / (double) ((TileEnergyStorageCore) tile).getMaxEnergyStored();
    float brightness = (float) Math.abs(Math.sin((float) Minecraft.getSystemTime() / 3000f) * 100f);

    colour = 1f - colour;
    GL11.glScalef(scale, scale, scale);
    GL11.glPushMatrix();
    GL11.glRotatef(rotation, 0F, 1F, 0.5F);
    GL11.glColor4d(1F, colour * 0.3f, colour * 0.7f, 1F);
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, 80f + brightness, 80f + brightness);
    iner_model.renderAll();
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glScalef(0.8F, 0.8F, 0.8F);
    GL11.glColor4d(1F, 1f, 0.2f, 1F);
    GL11.glRotatef(rotation, 0F, 1F, 0.5F);
    iner_model.renderAll();
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glScalef(0.9F, 0.9F, 0.9F);
    GL11.glColor4d(1F, 0f, 0.2f, 1F);
    GL11.glRotatef(rotation, 0F, 1F, 0.5F);
    iner_model.renderAll();
    GL11.glPopMatrix();

    GL11.glScalef(1.1F, 1.1F, 1.1F);
    GL11.glDepthMask(false);
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glRotatef(rotation * 0.5F, 0F, -1F, -0.5F);
    GL11.glColor4f(0.5F, 2F, 2F, 0.7F);
    iner_model.renderAll();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_LIGHTING);

    GL11.glPopMatrix();
  }
コード例 #14
0
 public void render() {
   modelAlienPowerSource.renderAll();
 }
コード例 #15
0
 public void renderSideGear() {
   modelSideGear.renderAll();
 }
コード例 #16
0
 public void renderWalker() {
   modelWalker.renderAll();
 }
コード例 #17
0
 public void renderBase() {
   modelBase.renderAll();
 }
コード例 #18
0
  @Override
  public void renderTileEntityAt(
      TileEntity tile, double screenX, double screenY, double screenZ, float partialTicks) {
    GL11.glPushMatrix();

    TileEntityDeconstructor d = (TileEntityDeconstructor) tile;

    GL11.glTranslated(screenX + 0.5D, screenY, screenZ + 0.5D);
    GL11.glScalef(0.4F, 0.4F, 0.4F);
    Minecraft.getMinecraft().renderEngine.bindTexture(frameIcon);
    model.renderPart("Cube_Cube.001");

    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    Minecraft.getMinecraft().renderEngine.bindTexture(glassIcon);
    model.renderPart("Plane");

    GL11.glEnable(GL11.GL_ALPHA_TEST);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDepthMask(true);
    char c0 = 61680;
    int j = c0 % 65536;
    int k = c0 / 65536;
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    if (d.hasAir) {
      Minecraft.getMinecraft().renderEngine.bindTexture(air);
      model.renderPart("Sphere");
    }

    if (d.hasFire) {
      Minecraft.getMinecraft().renderEngine.bindTexture(fire);
      model.renderPart("Sphere.001");
    }

    if (d.hasWater) {
      Minecraft.getMinecraft().renderEngine.bindTexture(water);
      model.renderPart("Sphere.002");
    }

    if (d.hasEarth) {
      Minecraft.getMinecraft().renderEngine.bindTexture(earth);
      model.renderPart("Sphere.003");
    }

    if (d.hasOrdo) {
      Minecraft.getMinecraft().renderEngine.bindTexture(ordo);
      model.renderPart("Sphere.004");
    }

    if (d.hasEntropy) {
      Minecraft.getMinecraft().renderEngine.bindTexture(entropy);
      model.renderPart("Sphere.005");
    }

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);

    GL11.glPopMatrix();
  }
コード例 #19
0
  @Override
  public void doRender(
      Entity ent, double x, double y, double z, float p_76986_8_, float partialTicks) {
    EntityGapingVoid egv = (EntityGapingVoid) ent;
    Minecraft mc = Minecraft.getMinecraft();
    mc.renderEngine.bindTexture(this.halo);
    Tessellator tess = Tessellator.instance;

    double age = egv.getAge() + partialTicks;

    setColour(age, 1.0);

    double scale = EntityGapingVoid.getVoidScale(age);

    double fullfadedist = 0.6 * scale;
    double fadedist = fullfadedist + 1.5;

    double halocoord = 0.58 * scale;
    double haloscaledist = 2.2 * scale;

    double dx = ent.posX - RenderManager.renderPosX;
    double dy = ent.posY - RenderManager.renderPosY;
    double dz = ent.posZ - RenderManager.renderPosZ;

    double xzlen = Math.sqrt(dx * dx + dz * dz);
    double len = Math.sqrt(dx * dx + dy * dy + dz * dz);

    if (len <= haloscaledist) {
      double close = (haloscaledist - len) / haloscaledist;
      halocoord *= 1.0 + close * close * close * close * 1.5;
    }

    double yang = Math.atan2(xzlen, dy) * ClientProxy.toDeg;
    double xang = Math.atan2(dx, dz) * ClientProxy.toDeg;

    // Lumberjack.info("dx: "+dx+", dy: "+dy+", dz: "+dz+", xang: "+xang);
    // Lumberjack.info("x: "+x+", y: "+y+", z: "+z);

    GL11.glDisable(GL11.GL_LIGHTING);
    mc.entityRenderer.disableLightmap(0.0);

    GL11.glPushMatrix();
    {
      GL11.glTranslated(x, y, z);

      GL11.glRotated(xang, 0, 1, 0);
      GL11.glRotated(yang + 90, 1, 0, 0);

      GL11.glPushMatrix();
      {
        GL11.glRotated(90, 1, 0, 0);

        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDepthMask(false);

        tess.startDrawingQuads();
        tess.addVertexWithUV(-halocoord, 0.0, -halocoord, 0.0, 0.0);
        tess.addVertexWithUV(-halocoord, 0.0, halocoord, 0.0, 1.0);
        tess.addVertexWithUV(halocoord, 0.0, halocoord, 1.0, 1.0);
        tess.addVertexWithUV(halocoord, 0.0, -halocoord, 1.0, 0.0);
        tess.draw();

        GL11.glDepthMask(true);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
      }
      GL11.glPopMatrix();

      Minecraft.getMinecraft().renderEngine.bindTexture(this.fill);

      GL11.glScaled(scale, scale, scale);

      model.renderAll();
    }
    GL11.glPopMatrix();

    if (len <= fadedist) {
      double alpha = 1.0;
      if (len >= fullfadedist) {
        alpha = 1.0 - ((len - fullfadedist) / (fadedist - fullfadedist));
        alpha = alpha * alpha * (3 - 2 * alpha);
      }
      setColour(age, alpha);
      GL11.glPushMatrix();
      {
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glEnable(GL11.GL_BLEND);

        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

        double d = 0;

        tess.startDrawingQuads();
        tess.addVertexWithUV(-100, 100, d, 0.0, 0.0);
        tess.addVertexWithUV(-100, -100, d, 0.0, 1.0);
        tess.addVertexWithUV(100, -100, d, 1.0, 1.0);
        tess.addVertexWithUV(100, 100, d, 1.0, 0.0);
        tess.draw();

        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
      }
      GL11.glPopMatrix();
    }

    mc.entityRenderer.enableLightmap(0.0);
    GL11.glEnable(GL11.GL_LIGHTING);

    GL11.glColor4d(1, 1, 1, 1);
  }
コード例 #20
0
ファイル: ModelPal.java プロジェクト: vdvman1/pal
 public void renderAll() {
   modelPal.renderPart("Center");
   for (String part : sideToModelPart) {
     modelPal.renderPart(part + "_off");
   }
 }
コード例 #21
0
ファイル: ModelFancyNode.java プロジェクト: Kehlim/LetsMod
 public void render() {
   modelFancyNode.renderAll();
 }
コード例 #22
0
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    switch (type) {
      case EQUIPPED:
        {
          GL11.glPushMatrix();
          float scale = 0.325F;
          GL11.glScalef(scale, scale, scale);
          GL11.glTranslatef(3.2F, -0.75F, -0.2F);
          // ANGLE, X ROTATE, Y ROTATE, Z ROTATE
          GL11.glRotatef(22F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);

          Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
          model.renderAll();

          GL11.glPopMatrix();
        }
        break;

      case EQUIPPED_FIRST_PERSON:
        {
          float f = 0.5F;
          GL11.glPushMatrix();
          GL11.glScalef(f, f, f);

          // ANGLE, X ROTATE, Y ROTATE, Z ROTATE
          // GL11.glRotatef(-135F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);

          GL11.glTranslatef(1.0F, -0.9F, 0.3F);

          Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
          model.renderAll();

          GL11.glPopMatrix();
        }
        break;

      case INVENTORY:
        {
          GL11.glPushMatrix();

          GL11.glEnable(GL11.GL_TEXTURE_2D);
          float scale = 0.4F;
          GL11.glScalef(scale, scale, scale);

          // GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);

          GL11.glTranslatef(0.0F, -1.4F, 0.0F);

          Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
          model.renderAll();

          GL11.glPopMatrix();
        }
        break;

      case ENTITY:
        {
          GL11.glPushMatrix();
          float scale = 0.5F;
          GL11.glScalef(scale, scale, scale);

          GL11.glTranslatef(0.0F, -0.4F, 0.0F);

          Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
          model.renderAll();

          GL11.glPopMatrix();
        }
        break;

      default:
        break;
    }
  }