Example usage for org.lwjgl.opengl GL11 glDisable

List of usage examples for org.lwjgl.opengl GL11 glDisable

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glDisable.

Prototype

public static void glDisable(@NativeType("GLenum") int target) 

Source Link

Document

Disables the specified OpenGL state.

Usage

From source file:com.sci.machinery.render.RenderTube.java

License:LGPL

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    if (type == ItemRenderType.INVENTORY) {
        GL11.glPushMatrix();/* ww  w  .j a  va2 s  .  co  m*/
        double x = 0;
        double y = 0;
        double z = 0;

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

        GL11.glDisable(GL11.GL_LIGHTING);

        setColor(item.itemID, 0);

        this.bindTexture(tubeIcon);

        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + 0, y + OA, z + 0);
        tess.addVertex(x + O, y + OA, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);

        tess.addVertex(x + 0, y + O - OA, z + 0);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + O - OA, z + 0);

        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + OA, y + O, z + 0);
        tess.addVertex(x + OA, y + 0, z + 0);

        tess.addVertex(x + O - OA, y + 0, z + 0);
        tess.addVertex(x + O - OA, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);

        //

        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + 0, y + OA, z + O);
        tess.addVertex(x + 0, y + OA, z + 0);
        tess.addVertex(x + 0, y + 0, z + 0);

        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + O - OA, z + 0);
        tess.addVertex(x + 0, y + O - OA, z + O);

        tess.addVertex(x + 0, y + O, z + OA);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + 0, y + 0, z + OA);

        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + O - OA);
        tess.addVertex(x + 0, y + 0, z + O - OA);
        tess.addVertex(x + 0, y + 0, z + O);

        //

        tess.addVertex(x + O, y + OA, z + 0);
        tess.addVertex(x + O, y + OA, z + O);
        tess.addVertex(x + O, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + 0);

        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + O - OA, z + O);
        tess.addVertex(x + O, y + O - OA, z + 0);

        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + OA);
        tess.addVertex(x + O, y + 0, z + OA);
        tess.addVertex(x + O, y + 0, z + 0);

        tess.addVertex(x + O, y + O, z + O - OA);
        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + O - OA);

        //

        tess.addVertex(x + O, y + OA, z + O);
        tess.addVertex(x + 0, y + OA, z + O);
        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + O);

        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + O - OA, z + O);
        tess.addVertex(x + O, y + O - OA, z + O);

        tess.addVertex(x + OA, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + OA, y + 0, z + O);

        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O - OA, y + O, z + O);
        tess.addVertex(x + O - OA, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + O);
        //

        tess.addVertex(x + OA, y + O, z + O);
        tess.addVertex(x + OA, y + O, z + 0);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + O, z + O);

        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + O, z + O - OA);
        tess.addVertex(x + 0, y + O, z + O - OA);

        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + O, z + OA);
        tess.addVertex(x + O, y + O, z + OA);
        tess.addVertex(x + O, y + O, z + 0);

        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O - OA, y + O, z + 0);
        tess.addVertex(x + O - OA, y + O, z + O);

        //

        tess.addVertex(x + OA, y + 0, z + O);
        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + OA, y + 0, z + 0);

        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + 0, y + 0, z + O - OA);
        tess.addVertex(x + O, y + 0, z + O - OA);
        tess.addVertex(x + O, y + 0, z + O);

        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + OA);
        tess.addVertex(x + 0, y + 0, z + OA);

        tess.addVertex(x + O - OA, y + 0, z + O);
        tess.addVertex(x + O - OA, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + O);

        renderSide(2, x, y, z);
        renderSide(3, x, y, z);

        tess.draw();
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    } else {
        double x = 0;
        double y = 0.75;
        double z = 0;

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

        GL11.glDisable(GL11.GL_LIGHTING);

        setColor(item.itemID, 0);

        this.bindTexture(tubeIcon);

        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + 0, y + OA, z + 0);
        tess.addVertex(x + O, y + OA, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);

        tess.addVertex(x + 0, y + O - OA, z + 0);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + O - OA, z + 0);

        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + OA, y + O, z + 0);
        tess.addVertex(x + OA, y + 0, z + 0);

        tess.addVertex(x + O - OA, y + 0, z + 0);
        tess.addVertex(x + O - OA, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);

        //

        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + 0, y + OA, z + O);
        tess.addVertex(x + 0, y + OA, z + 0);
        tess.addVertex(x + 0, y + 0, z + 0);

        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + O - OA, z + 0);
        tess.addVertex(x + 0, y + O - OA, z + O);

        tess.addVertex(x + 0, y + O, z + OA);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + 0, y + 0, z + OA);

        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + O - OA);
        tess.addVertex(x + 0, y + 0, z + O - OA);
        tess.addVertex(x + 0, y + 0, z + O);

        //

        tess.addVertex(x + O, y + OA, z + 0);
        tess.addVertex(x + O, y + OA, z + O);
        tess.addVertex(x + O, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + 0);

        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + O - OA, z + O);
        tess.addVertex(x + O, y + O - OA, z + 0);

        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O, y + O, z + OA);
        tess.addVertex(x + O, y + 0, z + OA);
        tess.addVertex(x + O, y + 0, z + 0);

        tess.addVertex(x + O, y + O, z + O - OA);
        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + O - OA);

        //

        tess.addVertex(x + O, y + OA, z + O);
        tess.addVertex(x + 0, y + OA, z + O);
        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + O);

        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + O - OA, z + O);
        tess.addVertex(x + O, y + O - OA, z + O);

        tess.addVertex(x + OA, y + O, z + O);
        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + OA, y + 0, z + O);

        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O - OA, y + O, z + O);
        tess.addVertex(x + O - OA, y + 0, z + O);
        tess.addVertex(x + O, y + 0, z + O);

        //

        tess.addVertex(x + OA, y + O, z + O);
        tess.addVertex(x + OA, y + O, z + 0);
        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + O, z + O);

        tess.addVertex(x + 0, y + O, z + O);
        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + O, z + O - OA);
        tess.addVertex(x + 0, y + O, z + O - OA);

        tess.addVertex(x + 0, y + O, z + 0);
        tess.addVertex(x + 0, y + O, z + OA);
        tess.addVertex(x + O, y + O, z + OA);
        tess.addVertex(x + O, y + O, z + 0);

        tess.addVertex(x + O, y + O, z + O);
        tess.addVertex(x + O, y + O, z + 0);
        tess.addVertex(x + O - OA, y + O, z + 0);
        tess.addVertex(x + O - OA, y + O, z + O);

        //

        tess.addVertex(x + OA, y + 0, z + O);
        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + OA, y + 0, z + 0);

        tess.addVertex(x + 0, y + 0, z + O);
        tess.addVertex(x + 0, y + 0, z + O - OA);
        tess.addVertex(x + O, y + 0, z + O - OA);
        tess.addVertex(x + O, y + 0, z + O);

        tess.addVertex(x + 0, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + OA);
        tess.addVertex(x + 0, y + 0, z + OA);

        tess.addVertex(x + O - OA, y + 0, z + O);
        tess.addVertex(x + O - OA, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + 0);
        tess.addVertex(x + O, y + 0, z + O);

        renderSide(2, x, y, z);
        renderSide(3, x, y, z);

        tess.draw();

        tess.addVertex(x + O, y + O - OA, z + O);
        GL11.glEnable(GL11.GL_LIGHTING);
    }
}

From source file:com.sci.machinery.render.RenderTube.java

License:LGPL

@Override
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) {
    if (!(t instanceof TileTube)) {
        throw new RuntimeException("Got a non-ITubeConnectable tile in RenderTube!");
    }// w  ww . ja  v a2  s  . c  o m

    TileTube tube = (TileTube) t;

    x += OF;
    y += OF;
    z += OF;

    GL11.glDisable(GL11.GL_LIGHTING);

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

    setColor(tube);

    this.bindTexture(tubeIcon);

    tess.addVertex(x + 0, y + 0, z + 0);
    tess.addVertex(x + 0, y + OA, z + 0);
    tess.addVertex(x + O, y + OA, z + 0);
    tess.addVertex(x + O, y + 0, z + 0);

    tess.addVertex(x + 0, y + O - OA, z + 0);
    tess.addVertex(x + 0, y + O, z + 0);
    tess.addVertex(x + O, y + O, z + 0);
    tess.addVertex(x + O, y + O - OA, z + 0);

    tess.addVertex(x + 0, y + 0, z + 0);
    tess.addVertex(x + 0, y + O, z + 0);
    tess.addVertex(x + OA, y + O, z + 0);
    tess.addVertex(x + OA, y + 0, z + 0);

    tess.addVertex(x + O - OA, y + 0, z + 0);
    tess.addVertex(x + O - OA, y + O, z + 0);
    tess.addVertex(x + O, y + O, z + 0);
    tess.addVertex(x + O, y + 0, z + 0);

    //

    tess.addVertex(x + 0, y + 0, z + O);
    tess.addVertex(x + 0, y + OA, z + O);
    tess.addVertex(x + 0, y + OA, z + 0);
    tess.addVertex(x + 0, y + 0, z + 0);

    tess.addVertex(x + 0, y + O, z + O);
    tess.addVertex(x + 0, y + O, z + 0);
    tess.addVertex(x + 0, y + O - OA, z + 0);
    tess.addVertex(x + 0, y + O - OA, z + O);

    tess.addVertex(x + 0, y + O, z + OA);
    tess.addVertex(x + 0, y + O, z + 0);
    tess.addVertex(x + 0, y + 0, z + 0);
    tess.addVertex(x + 0, y + 0, z + OA);

    tess.addVertex(x + 0, y + O, z + O);
    tess.addVertex(x + 0, y + O, z + O - OA);
    tess.addVertex(x + 0, y + 0, z + O - OA);
    tess.addVertex(x + 0, y + 0, z + O);

    //

    tess.addVertex(x + O, y + OA, z + 0);
    tess.addVertex(x + O, y + OA, z + O);
    tess.addVertex(x + O, y + 0, z + O);
    tess.addVertex(x + O, y + 0, z + 0);

    tess.addVertex(x + O, y + O, z + 0);
    tess.addVertex(x + O, y + O, z + O);
    tess.addVertex(x + O, y + O - OA, z + O);
    tess.addVertex(x + O, y + O - OA, z + 0);

    tess.addVertex(x + O, y + O, z + 0);
    tess.addVertex(x + O, y + O, z + OA);
    tess.addVertex(x + O, y + 0, z + OA);
    tess.addVertex(x + O, y + 0, z + 0);

    tess.addVertex(x + O, y + O, z + O - OA);
    tess.addVertex(x + O, y + O, z + O);
    tess.addVertex(x + O, y + 0, z + O);
    tess.addVertex(x + O, y + 0, z + O - OA);

    //

    tess.addVertex(x + O, y + OA, z + O);
    tess.addVertex(x + 0, y + OA, z + O);
    tess.addVertex(x + 0, y + 0, z + O);
    tess.addVertex(x + O, y + 0, z + O);

    tess.addVertex(x + O, y + O, z + O);
    tess.addVertex(x + 0, y + O, z + O);
    tess.addVertex(x + 0, y + O - OA, z + O);
    tess.addVertex(x + O, y + O - OA, z + O);

    tess.addVertex(x + OA, y + O, z + O);
    tess.addVertex(x + 0, y + O, z + O);
    tess.addVertex(x + 0, y + 0, z + O);
    tess.addVertex(x + OA, y + 0, z + O);

    tess.addVertex(x + O, y + O, z + O);
    tess.addVertex(x + O - OA, y + O, z + O);
    tess.addVertex(x + O - OA, y + 0, z + O);
    tess.addVertex(x + O, y + 0, z + O);

    //

    tess.addVertex(x + OA, y + O, z + O);
    tess.addVertex(x + OA, y + O, z + 0);
    tess.addVertex(x + 0, y + O, z + 0);
    tess.addVertex(x + 0, y + O, z + O);

    tess.addVertex(x + 0, y + O, z + O);
    tess.addVertex(x + O, y + O, z + O);
    tess.addVertex(x + O, y + O, z + O - OA);
    tess.addVertex(x + 0, y + O, z + O - OA);

    tess.addVertex(x + 0, y + O, z + 0);
    tess.addVertex(x + 0, y + O, z + OA);
    tess.addVertex(x + O, y + O, z + OA);
    tess.addVertex(x + O, y + O, z + 0);

    tess.addVertex(x + O, y + O, z + O);
    tess.addVertex(x + O, y + O, z + 0);
    tess.addVertex(x + O - OA, y + O, z + 0);
    tess.addVertex(x + O - OA, y + O, z + O);

    //

    tess.addVertex(x + OA, y + 0, z + O);
    tess.addVertex(x + 0, y + 0, z + O);
    tess.addVertex(x + 0, y + 0, z + 0);
    tess.addVertex(x + OA, y + 0, z + 0);

    tess.addVertex(x + 0, y + 0, z + O);
    tess.addVertex(x + 0, y + 0, z + O - OA);
    tess.addVertex(x + O, y + 0, z + O - OA);
    tess.addVertex(x + O, y + 0, z + O);

    tess.addVertex(x + 0, y + 0, z + 0);
    tess.addVertex(x + O, y + 0, z + 0);
    tess.addVertex(x + O, y + 0, z + OA);
    tess.addVertex(x + 0, y + 0, z + OA);

    tess.addVertex(x + O - OA, y + 0, z + O);
    tess.addVertex(x + O - OA, y + 0, z + 0);
    tess.addVertex(x + O, y + 0, z + 0);
    tess.addVertex(x + O, y + 0, z + O);

    TileEntity[] tiles = Utils.getAdjacentTiles(tube.worldObj,
            new BlockCoord(tube.xCoord, tube.yCoord, tube.zCoord));
    for (int i = 0; i < 6; i++) {
        if (tube.canConnectTube(tiles[i])) {
            renderSide(i, x, y, z);
        }
    }

    tess.draw();

    GL11.glEnable(GL11.GL_LIGHTING);

    for (TravellingItem item : tube.getItems()) {
        renderItem(item, x, y, z);
    }
}

From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDragonBoss.java

License:Apache License

@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    GL11.glPushMatrix();//from w  w w  .j  av a 2s . co m
    EntityDragonBoss entitydragon = (EntityDragonBoss) par1Entity;
    float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * partialTicks;
    jaw.rotateAngleX = (float) (Math.sin(f6 * (float) Math.PI * 2.0F) + 1.0D) * 0.2F;
    float f7 = (float) (Math.sin(f6 * (float) Math.PI * 2.0F - 1.0F) + 1.0D);
    f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F;
    GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F);
    GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F);
    float f8 = -30.0F;
    float f9 = 0.0F;
    float f10 = 1.5F;
    double[] adouble = entitydragon.getMovementOffsets(6, partialTicks);
    float f11 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0]
            - entitydragon.getMovementOffsets(10, partialTicks)[0]);
    float f12 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] + f11 / 2.0F);
    f8 += 2.0F;
    float f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 20.0F;
    float f14 = -12.0F;
    float f15;

    for (int i = 0; i < 5; ++i) {
        double[] adouble1 = entitydragon.getMovementOffsets(5 - i, partialTicks);
        f15 = (float) Math.cos(i * 0.45F + f13) * 0.15F;
        neck.rotateAngleY = updateRotations(adouble1[0] - adouble[0]) * (float) Math.PI / 180.0F * f10;
        neck.rotateAngleX = f15 + (float) (adouble1[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = -updateRotations(adouble1[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    head.rotationPointY = f8;
    head.rotationPointZ = f14;
    head.rotationPointX = f9;
    double[] adouble2 = entitydragon.getMovementOffsets(0, partialTicks);
    head.rotateAngleY = updateRotations(adouble2[0] - adouble[0]) * (float) Math.PI / 180.0F * 1.0F;
    head.rotateAngleZ = -updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * 1.0F;
    head.render(par7);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-f11 * f10 * 1.0F, 0.0F, 0.0F, 1.0F);
    GL11.glTranslatef(0.0F, -1.0F, 0.0F);
    body.rotateAngleZ = 0.0F;
    body.render(par7);

    for (int j = 0; j < 2; ++j) {
        GL11.glEnable(GL11.GL_CULL_FACE);
        f15 = f6 * (float) Math.PI * 2.0F;
        wing.rotateAngleX = 0.125F - (float) Math.cos(f15) * 0.2F;
        wing.rotateAngleY = 0.25F;
        wing.rotateAngleZ = (float) (Math.sin(f15) + 0.125D) * 0.8F;
        wingTip.rotateAngleZ = -((float) (Math.sin(f15 + 2.0F) + 0.5D)) * 0.75F;
        rearLeg.rotateAngleX = 1.0F + f7 * 0.1F;
        rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F;
        rearFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        frontLeg.rotateAngleX = 1.3F + f7 * 0.1F;
        frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F;
        frontFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        wing.render(par7);
        frontLeg.render(par7);
        rearLeg.render(par7);
        GL11.glScalef(-1.0F, 1.0F, 1.0F);

        if (j == 0)
            GL11.glCullFace(GL11.GL_FRONT);
    }

    GL11.glPopMatrix();
    GL11.glCullFace(GL11.GL_BACK);
    GL11.glDisable(GL11.GL_CULL_FACE);
    float f16 = -((float) Math.sin(f6 * (float) Math.PI * 2.0F)) * 0.0F;
    f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 10.0F;
    f14 = 60.0F;
    f9 = 0.0F;
    adouble = entitydragon.getMovementOffsets(11, partialTicks);

    for (int k = 0; k < 12; ++k) {
        adouble2 = entitydragon.getMovementOffsets(12 + k, partialTicks);
        f16 = (float) (f16 + Math.sin(k * 0.45F + f13) * 0.05000000074505806D);
        neck.rotateAngleY = (updateRotations(adouble2[0] - adouble[0]) * f10 + 180.0F) * (float) Math.PI
                / 180.0F;
        neck.rotateAngleX = f16 + (float) (adouble2[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    GL11.glPopMatrix();
}

From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDragonMinion.java

License:Apache License

@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    GL11.glPushMatrix();//from   w  ww.ja  v  a 2  s  . c  o m
    EntityDragonMinion entitydragon = (EntityDragonMinion) par1Entity;
    float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * partialTicks;
    jaw.rotateAngleX = (float) (Math.sin(f6 * (float) Math.PI * 2.0F) + 1.0D) * 0.2F;
    float f7 = (float) (Math.sin(f6 * (float) Math.PI * 2.0F - 1.0F) + 1.0D);
    f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F;
    GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F);
    GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F);
    float f8 = -30.0F;
    float f9 = 0.0F;
    float f10 = 1.5F;
    double[] adouble = entitydragon.getMovementOffsets(6, partialTicks);
    float f11 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0]
            - entitydragon.getMovementOffsets(10, partialTicks)[0]);
    float f12 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] + f11 / 2.0F);
    f8 += 2.0F;
    float f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 20.0F;
    float f14 = -12.0F;
    float f15;

    for (int i = 0; i < 5; ++i) {
        double[] adouble1 = entitydragon.getMovementOffsets(5 - i, partialTicks);
        f15 = (float) Math.cos(i * 0.45F + f13) * 0.15F;
        neck.rotateAngleY = updateRotations(adouble1[0] - adouble[0]) * (float) Math.PI / 180.0F * f10;
        neck.rotateAngleX = f15 + (float) (adouble1[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = -updateRotations(adouble1[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    head.rotationPointY = f8;
    head.rotationPointZ = f14;
    head.rotationPointX = f9;
    double[] adouble2 = entitydragon.getMovementOffsets(0, partialTicks);
    head.rotateAngleY = updateRotations(adouble2[0] - adouble[0]) * (float) Math.PI / 180.0F * 1.0F;
    head.rotateAngleZ = -updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * 1.0F;
    head.render(par7);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-f11 * f10 * 1.0F, 0.0F, 0.0F, 1.0F);
    GL11.glTranslatef(0.0F, -1.0F, 0.0F);
    body.rotateAngleZ = 0.0F;
    body.render(par7);

    for (int j = 0; j < 2; ++j) {
        GL11.glEnable(GL11.GL_CULL_FACE);
        f15 = f6 * (float) Math.PI * 2.0F;
        wing.rotateAngleX = 0.125F - (float) Math.cos(f15) * 0.2F;
        wing.rotateAngleY = 0.25F;
        wing.rotateAngleZ = (float) (Math.sin(f15) + 0.125D) * 0.8F;
        wingTip.rotateAngleZ = -((float) (Math.sin(f15 + 2.0F) + 0.5D)) * 0.75F;
        rearLeg.rotateAngleX = 1.0F + f7 * 0.1F;
        rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F;
        rearFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        frontLeg.rotateAngleX = 1.3F + f7 * 0.1F;
        frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F;
        frontFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        wing.render(par7);
        frontLeg.render(par7);
        rearLeg.render(par7);
        GL11.glScalef(-1.0F, 1.0F, 1.0F);

        if (j == 0)
            GL11.glCullFace(GL11.GL_FRONT);
    }

    GL11.glPopMatrix();
    GL11.glCullFace(GL11.GL_BACK);
    GL11.glDisable(GL11.GL_CULL_FACE);
    float f16 = -((float) Math.sin(f6 * (float) Math.PI * 2.0F)) * 0.0F;
    f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 10.0F;
    f14 = 60.0F;
    f9 = 0.0F;
    adouble = entitydragon.getMovementOffsets(11, partialTicks);

    for (int k = 0; k < 12; ++k) {
        adouble2 = entitydragon.getMovementOffsets(12 + k, partialTicks);
        f16 = (float) (f16 + Math.sin(k * 0.45F + f13) * 0.05000000074505806D);
        neck.rotateAngleY = (updateRotations(adouble2[0] - adouble[0]) * f10 + 180.0F) * (float) Math.PI
                / 180.0F;
        neck.rotateAngleX = f16 + (float) (adouble2[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    GL11.glPopMatrix();
}

From source file:com.shinoow.abyssalcraft.client.render.block.RenderODB.java

License:Apache License

public void doRender(EntityODBPrimed par1EntityODBPrimed, double par2, double par4, double par6, float par8,
        float par9) {
    GL11.glPushMatrix();/*  w  ww.java2 s .  c  om*/
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    float var10;
    if (par1EntityODBPrimed.fuse - par9 + 1.0F < 10.0F) {
        var10 = 1.0F - (par1EntityODBPrimed.fuse - par9 + 1.0F) / 10.0F;

        if (var10 < 0.0F)
            var10 = 0.0F;
        if (var10 > 1.0F)
            var10 = 1.0F;

        var10 *= var10;
        var10 *= var10;
        float var11 = 1.0F + var10 * 0.3F;
        GL11.glScalef(var11, var11, var11);
    }

    var10 = (1.0F - (par1EntityODBPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F;
    bindEntityTexture(par1EntityODBPrimed);
    blockRenderer.renderBlockAsItem(AbyssalCraft.ODB, 0, par1EntityODBPrimed.getBrightness(par9));

    if (par1EntityODBPrimed.fuse / 5 % 2 == 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, var10);
        blockRenderer.renderBlockAsItem(AbyssalCraft.ODB, 0, 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    GL11.glPopMatrix();
}

From source file:com.shinoow.abyssalcraft.client.render.block.RenderODBc.java

License:Apache License

public void doRender(EntityODBcPrimed par1EntityODBcPrimed, double par2, double par4, double par6, float par8,
        float par9) {

    GL11.glPushMatrix();/*ww  w  .  ja  v  a  2 s. c o  m*/
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    float var10;

    if (par1EntityODBcPrimed.fuse - par9 + 1.0F < 10.0F) {
        var10 = 1.0F - (par1EntityODBcPrimed.fuse - par9 + 1.0F) / 10.0F;

        if (var10 < 0.0F)
            var10 = 0.0F;
        if (var10 > 1.0F)
            var10 = 1.0F;

        var10 *= var10;
        var10 *= var10;
        float var11 = 1.0F + var10 * 0.3F;
        GL11.glScalef(var11, var11, var11);
    }

    var10 = (1.0F - (par1EntityODBcPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F;
    bindEntityTexture(par1EntityODBcPrimed);
    blockRenderer.renderBlockAsItem(AbyssalCraft.ODBcore, 0, par1EntityODBcPrimed.getBrightness(par9));

    if (par1EntityODBcPrimed.fuse / 5 % 2 == 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, var10);
        blockRenderer.renderBlockAsItem(AbyssalCraft.ODBcore, 0, 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    GL11.glPopMatrix();
}

From source file:com.shinoow.abyssalcraft.client.render.entity.RenderAntiSpider.java

License:Apache License

protected int shouldRenderPass(EntityAntiSpider par1EntityAntiSpider, int par2, float par3) {
    if (par2 != 0)
        return -1;
    else {/*from w  w w . j a va2  s.c o m*/
        bindTexture(spiderEyesTextures);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);

        if (par1EntityAntiSpider.isInvisible())
            GL11.glDepthMask(false);
        else
            GL11.glDepthMask(true);

        char c0 = 61680;
        int j = c0 % 65536;
        int k = c0 / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        return 1;
    }
}

From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java

License:Apache License

/**
 * Renders the dragon model. Called by renderModel.
 *///  ww  w .  j  av  a2 s.  c o m
protected void renderDragonModel(EntityDragonBoss par1EntityDragonBoss, float par2, float par3, float par4,
        float par5, float par6, float par7) {
    if (par1EntityDragonBoss.deathTicks > 0) {
        float f6 = par1EntityDragonBoss.deathTicks / 200.0F;
        GL11.glDepthFunc(GL11.GL_LEQUAL);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glAlphaFunc(GL11.GL_GREATER, f6);
        bindTexture(field_110842_f);
        mainModel.render(par1EntityDragonBoss, par2, par3, par4, par5, par6, par7);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
        GL11.glDepthFunc(GL11.GL_EQUAL);
    }

    bindEntityTexture(par1EntityDragonBoss);
    mainModel.render(par1EntityDragonBoss, par2, par3, par4, par5, par6, par7);

    if (par1EntityDragonBoss.hurtTime > 0) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F);
        mainModel.render(par1EntityDragonBoss, par2, par3, par4, par5, par6, par7);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
    }
}

From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java

License:Apache License

/**
 * Renders the dragon, along with its dying animation
 *///from   w  w  w . j av  a  2 s . c  om
public void renderDragon(EntityDragonBoss par1entitydragonboss, double par2, double par4, double par6,
        float par8, float par9) {
    BossStatus.setBossStatus(par1entitydragonboss, false);
    super.doRender(par1entitydragonboss, par2, par4, par6, par8, par9);

    if (par1entitydragonboss.healingcircle != null) {
        float f2 = EntityDragonMinion.innerRotation + par9;
        float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
        f3 = (f3 * f3 + f3) * 0.2F;
        float f4 = (float) (par1entitydragonboss.healingcircle.posX - par1entitydragonboss.posX
                - (par1entitydragonboss.prevPosX - par1entitydragonboss.posX) * (1.0F - par9));
        float f5 = (float) (f3 + par1entitydragonboss.healingcircle.posY - 1.0D - par1entitydragonboss.posY
                - (par1entitydragonboss.prevPosY - par1entitydragonboss.posY) * (1.0F - par9));
        float f6 = (float) (par1entitydragonboss.healingcircle.posZ - par1entitydragonboss.posZ
                - (par1entitydragonboss.prevPosZ - par1entitydragonboss.posZ) * (1.0F - par9));
        float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
        float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
        GL11.glPushMatrix();
        GL11.glTranslatef((float) par2, (float) par4 + 2.0F, (float) par6);
        GL11.glRotatef((float) -Math.atan2(f6, f4) * 180.0F / (float) Math.PI - 90.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef((float) -Math.atan2(f7, f5) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
        Tessellator tessellator = Tessellator.instance;
        RenderHelper.disableStandardItemLighting();
        GL11.glDisable(GL11.GL_CULL_FACE);
        bindTexture(field_110843_g);
        GL11.glShadeModel(GL11.GL_SMOOTH);
        float f9 = 0.0F - (par1entitydragonboss.ticksExisted + par9) * 0.01F;
        float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F
                - (par1entitydragonboss.ticksExisted + par9) * 0.01F;
        tessellator.startDrawing(5);
        byte b0 = 8;

        for (int i = 0; i <= b0; ++i) {
            float f11 = MathHelper.sin(i % b0 * (float) Math.PI * 2.0F / b0) * 0.75F;
            float f12 = MathHelper.cos(i % b0 * (float) Math.PI * 2.0F / b0) * 0.75F;
            float f13 = i % b0 * 1.0F / b0;
            tessellator.setColorOpaque_I(0);
            tessellator.addVertexWithUV(f11 * 0.2F, f12 * 0.2F, 0.0D, f13, f10);
            tessellator.setColorOpaque_I(16777215);
            tessellator.addVertexWithUV(f11, f12, f8, f13, f9);
        }

        tessellator.draw();
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glShadeModel(GL11.GL_FLAT);
        RenderHelper.enableStandardItemLighting();
        GL11.glPopMatrix();
    }
}

From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java

License:Apache License

/**
 * Renders the animation for when an enderdragon dies
 *///from   w  ww. j a v  a2s.c  o m
protected void renderDragonDying(EntityDragonBoss par1entitydragonboss, float par2) {
    super.renderEquippedItems(par1entitydragonboss, par2);
    Tessellator tessellator = Tessellator.instance;

    if (par1entitydragonboss.deathTicks > 0) {
        RenderHelper.disableStandardItemLighting();
        float f1 = (par1entitydragonboss.deathTicks + par2) / 200.0F;
        float f2 = 0.0F;

        if (f1 > 0.8F)
            f2 = (f1 - 0.8F) / 0.2F;

        Random random = new Random(432L);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glShadeModel(GL11.GL_SMOOTH);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDepthMask(false);
        GL11.glPushMatrix();
        GL11.glTranslatef(0.0F, -1.0F, -2.0F);

        for (int i = 0; i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i) {
            GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F);
            tessellator.startDrawing(6);
            float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F;
            float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F;
            tessellator.setColorRGBA_I(16777215, (int) (255.0F * (1.0F - f2)));
            tessellator.addVertex(0.0D, 0.0D, 0.0D);
            tessellator.setColorRGBA_I(16711935, 0);
            tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
            tessellator.addVertex(0.866D * f4, f3, -0.5F * f4);
            tessellator.addVertex(0.0D, f3, 1.0F * f4);
            tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
            tessellator.draw();
        }

        GL11.glPopMatrix();
        GL11.glDepthMask(true);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glShadeModel(GL11.GL_FLAT);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        RenderHelper.enableStandardItemLighting();
    }
}