Example usage for org.lwjgl.opengl GL11 glScalef

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

Introduction

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

Prototype

public static native void glScalef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y,
        @NativeType("GLfloat") float z);

Source Link

Document

Manipulates the current matrix with a general scaling matrix along the x-, y- and z- axes.

Usage

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

License:Apache License

@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    super.render(par1Entity, par2, par3, par4, par5, par6, par7);
    setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);

    if (isChild) {
        float f6 = 2.0F;
        GL11.glPushMatrix();//from ww w .jav a 2  s. c o m
        GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6);
        GL11.glTranslatef(0.0F, 21.0F * par7, 0.0F);
        Head.render(par7);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
        GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
        Spine1.render(par7);
        Spine2.render(par7);
        lrib1.render(par7);
        lrib2.render(par7);
        lrib3.render(par7);
        rrib1.render(par7);
        rrib2.render(par7);
        rrib3.render(par7);
        pelvis.render(par7);
        Spine3.render(par7);
        larm1.render(par7);
        rarm1.render(par7);
        lleg.render(par7);
        rleg.render(par7);
        back.render(par7);
        lside.render(par7);
        rside.render(par7);
        GL11.glPopMatrix();
    } else {
        Head.render(par7);
        Spine1.render(par7);
        Spine2.render(par7);
        lrib1.render(par7);
        lrib2.render(par7);
        lrib3.render(par7);
        rrib1.render(par7);
        rrib2.render(par7);
        rrib3.render(par7);
        pelvis.render(par7);
        Spine3.render(par7);
        larm1.render(par7);
        rarm1.render(par7);
        lleg.render(par7);
        rleg.render(par7);
        back.render(par7);
        lside.render(par7);
        rside.render(par7);
    }
}

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 www.  ja va2 s.c  o 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 w  w.ja  v a  2  s .c  om*/
    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  w  w  . j a  v  a2  s  . co  m
    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();/*  w w  w.  j a  va2s  .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.RenderAntiBat.java

License:Apache License

protected void preRenderCallback(EntityAntiBat par1EntityBat, float par2) {
    GL11.glScalef(0.35F, 0.35F, 0.35F);
}

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

License:Apache License

protected void preRenderCallback(EntityAntiCreeper par1EntityAntiCreeper, float par2) {
    float f1 = par1EntityAntiCreeper.getCreeperFlashIntensity(par2);
    float f2 = 1.0F + MathHelper.sin(f1 * 100.0F) * f1 * 0.01F;

    if (f1 < 0.0F)
        f1 = 0.0F;/*  w w  w .j  a v  a  2s.c om*/

    if (f1 > 1.0F)
        f1 = 1.0F;

    f1 *= f1;
    f1 *= f1;
    float f3 = (1.0F + f1 * 0.4F) * f2;
    float f4 = (1.0F + f1 * 0.1F) / f2;
    GL11.glScalef(f3, f4, f3);
}

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

License:Apache License

/**
 * Applies the scale to the transform matrix
 *///w  w w .  j a  v a 2s. c  om
protected void preRenderScale(EntityDragonBoss par1EntityDragonMinion, float par2) {
    GL11.glScalef(scale, scale, scale);
}

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

License:Apache License

/**
 * Applies the scale to the transform matrix
 *///from   w ww  .ja  v a2  s .  c o m
protected void preRenderScale(EntityDragonMinion par1EntityDragonMinion, float par2) {
    GL11.glScalef(scale, scale, scale);
}

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

License:Apache License

/**
 * Applies the scale to the transform matrix
 *//*  www  .  j a  v a2  s . co  m*/
protected void preRenderScale(EntityDreadguard par1Entitydreadguard, float par2) {
    GL11.glScalef(scale, scale, scale);
}