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:de.sanandrew.mods.claysoldiers.client.event.SoldierLeftHandRenderHandler.java

License:Creative Commons License

private static void renderLeftHandItem(EntityClayMan clayMan, RenderClayMan renderer, ItemStack stack) {
    GL11.glPushMatrix();//from   w  ww. ja va  2s. co m
    renderer.modelBipedMain.bipedLeftArm.postRender(0.0625F);
    GL11.glTranslatef(-0.1F, 0.6F, 0.0F);

    float itemScale = 0.6F;
    GL11.glScalef(itemScale, itemScale, itemScale);
    GL11.glRotatef(140.0F, 0.0F, 0.0F, 1.0F);
    GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);

    renderer.getItemRenderer().renderItem(clayMan, stack, 0);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierLeftHandRenderHandler.java

License:Creative Commons License

private static void renderThrowableBlock(EntityClayMan clayMan, RenderClayMan renderer, ItemStack stack) {
    GL11.glPushMatrix();//from   w  w  w. j a va2  s  .  c  om
    renderer.modelBipedMain.bipedLeftArm.postRender(0.0625F);
    GL11.glTranslatef(0.05F, 0.55F, 0.0F);
    GL11.glScalef(0.3F, 0.3F, 0.3F);
    renderer.getItemRenderer().renderItem(clayMan, stack, 0);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierLeftHandRenderHandler.java

License:Creative Commons License

private static void renderShield(EntityClayMan clayMan, RenderClayMan renderer) {
    IIcon icon = clayMan.hasUpgrade(SoldierUpgrades.UPG_IRON_BLOCK) ? Textures.s_shieldStudIcon
            : Textures.s_shieldIcon;/*from ww w .  jav a 2 s  .c o m*/

    GL11.glPushMatrix();
    renderer.modelBipedMain.bipedLeftArm.postRender(0.0625F);
    GL11.glTranslatef(-0.4F, 0.15F, -0.2F);
    GL11.glScalef(0.75F, 0.75F, 0.75F);
    ItemRenderHelper.renderIconIn3D(icon, false, false, 0xFFFFFF);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierModelRenderHandler.java

License:Creative Commons License

private void renderIronCoreBuff(EntityClayMan clayMan, RenderClayMan clayManRender, float partTicks) {
    ModelBiped model = clayManRender.modelBipedMain;

    this.buffedBody.rotateAngleX = model.bipedBody.rotateAngleX;
    this.buffedBody.rotateAngleY = model.bipedBody.rotateAngleY;
    this.buffedBody.rotateAngleZ = model.bipedBody.rotateAngleZ;

    clayManRender.bindTexture(clayMan.getTexture());
    GL11.glPushMatrix();//from ww  w .  j a v a2  s.  c  o m
    GL11.glScalef(1.5F, 1.5F, 1.5F);
    this.buffedBody.render(partTicks);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierModelRenderHandler.java

License:Creative Commons License

private void renderHideArmor(EntityClayMan clayMan, RenderClayMan clayManRender, float partTicks,
        String armorUpgrade) {/*ww  w .ja v  a 2 s  .c  o m*/
    ModelBiped model = clayManRender.modelBipedMain;

    this.armorBody.rotateAngleX = model.bipedBody.rotateAngleX;
    this.armorBody.rotateAngleY = model.bipedBody.rotateAngleY;
    this.armorBody.rotateAngleZ = model.bipedBody.rotateAngleZ;
    this.armorLeftArm.rotateAngleX = model.bipedLeftArm.rotateAngleX;
    this.armorLeftArm.rotateAngleY = model.bipedLeftArm.rotateAngleY;
    this.armorLeftArm.rotateAngleZ = model.bipedLeftArm.rotateAngleZ;
    this.armorRightArm.rotateAngleX = model.bipedRightArm.rotateAngleX;
    this.armorRightArm.rotateAngleY = model.bipedRightArm.rotateAngleY;
    this.armorRightArm.rotateAngleZ = model.bipedRightArm.rotateAngleZ;

    switch (armorUpgrade) {
    case SoldierUpgrades.UPG_LEATHER:
        clayManRender.bindTexture(Textures.CLAYMAN_LEATHER_ARMOR);
        break;
    case "not_implemented_rabbit_hide": //todo: implement rabbit hide texture when 1.8 arrives
        clayManRender.bindTexture(Textures.CLAYMAN_LEATHER_ARMOR);
        break;
    default:
        return;
    }

    GL11.glPushMatrix();
    GL11.glScalef(1.2F, 1.2F, 1.2F);
    this.armorBody.render(partTicks);
    this.armorLeftArm.render(partTicks);
    this.armorRightArm.render(partTicks);

    if (clayMan.hasUpgrade(SoldierUpgrades.UPG_IRON_INGOT)) {
        this.buffedBody.render(partTicks);
    }

    GL11.glPopMatrix();

    if (clayMan.hasUpgrade(SoldierUpgrades.UPG_WOOL)) {
        float[] color = getSplittedColor(clayMan.getMiscColor());

        clayManRender.bindTexture(Textures.CLAYMAN_PADDING);
        GL11.glPushMatrix();
        GL11.glScalef(1.1F, 1.1F, 1.1F);
        GL11.glColor3f(color[0], color[1], color[2]);
        this.armorBody.render(partTicks);
        this.armorLeftArm.render(partTicks);
        this.armorRightArm.render(partTicks);
        GL11.glPopMatrix();
    }
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierModelRenderHandler.java

License:Creative Commons License

private void renderSlimefeet(RenderClayMan clayManRender, float partTicks) {
    ModelBiped model = clayManRender.modelBipedMain;

    this.slimeLeftLeg.rotateAngleX = model.bipedLeftLeg.rotateAngleX;
    this.slimeLeftLeg.rotateAngleY = model.bipedLeftLeg.rotateAngleY;
    this.slimeLeftLeg.rotateAngleZ = model.bipedLeftLeg.rotateAngleZ;
    this.slimeRightLeg.rotateAngleX = model.bipedRightLeg.rotateAngleX;
    this.slimeRightLeg.rotateAngleY = model.bipedRightLeg.rotateAngleY;
    this.slimeRightLeg.rotateAngleZ = model.bipedRightLeg.rotateAngleZ;

    clayManRender.bindTexture(Textures.CLAYMAN_SLIMEFEET);
    GL11.glPushMatrix();/*from  w w  w. j  a  v a  2  s . com*/
    GL11.glScalef(1.2F, 1.2F, 1.2F);
    GL11.glTranslatef(0.0F, -0.2F, 0.0F);
    this.slimeLeftLeg.render(partTicks);
    this.slimeRightLeg.render(partTicks);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierRightHandRenderHandler.java

License:Creative Commons License

private static void renderRightHandItem(EntityClayMan clayMan, RenderClayMan renderer, ItemStack stack) {
    GL11.glPushMatrix();//from w  w  w .  j av a  2s  . c  o  m
    renderer.modelBipedMain.bipedRightArm.postRender(0.0625F);
    GL11.glTranslatef(-0.1F, 0.6F, 0.0F);

    float itemScale = 0.6F;
    GL11.glScalef(itemScale, itemScale, itemScale);
    GL11.glRotatef(140.0F, 0.0F, 0.0F, 1.0F);
    GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);

    renderer.getItemRenderer().renderItem(clayMan, stack, 0);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierRightHandRenderHandler.java

License:Creative Commons License

private static void renderKnuckle(EntityClayMan clayMan, RenderClayMan renderer, ItemStack stack) {
    GL11.glPushMatrix();/*from w ww. j  av a  2s .co m*/
    renderer.modelBipedMain.bipedRightArm.postRender(0.0625F);
    GL11.glTranslatef(-0.05F, 0.55F, 0.0F);
    GL11.glScalef(0.3F, 0.3F, 0.3F);
    renderer.getItemRenderer().renderItem(clayMan, stack, 0);
    GL11.glPopMatrix();
}

From source file:de.sanandrew.mods.claysoldiers.client.model.tileentity.ModelClayNexus.java

License:Creative Commons License

private static void renderScaledBox(ModelRenderer box, float scaleFactor) {
    Triplet<Float, Float, Float> rot = Triplet.with(box.rotateAngleX, box.rotateAngleY, box.rotateAngleZ);
    Triplet<Float, Float, Float> point = Triplet.with(box.rotationPointX, box.rotationPointY,
            box.rotationPointZ);//from  w  ww .j a  v  a  2s . co m
    setRotation(box, 0.0F, 0.0F, 0.0F);
    box.rotationPointX = 0.0F;
    box.rotationPointY = 0.0F;
    box.rotationPointZ = 0.0F;

    GL11.glPushMatrix();
    GL11.glTranslatef(point.getValue0() * scaleFactor, point.getValue1() * scaleFactor,
            point.getValue2() * scaleFactor);
    GL11.glRotatef(rot.getValue2() * (180.0F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
    GL11.glRotatef(rot.getValue1() * (180.0F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(rot.getValue0() * (180.0F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
    GL11.glScalef(1.01F, 1.01F, 1.01F);
    GL11.glTranslatef(0.0F, -0.00075F, 0.0F);
    box.render(scaleFactor);
    GL11.glPopMatrix();

    setRotation(box, rot.getValue0(), rot.getValue1(), rot.getValue2());
    box.rotationPointX = point.getValue0();
    box.rotationPointY = point.getValue1();
    box.rotationPointZ = point.getValue2();
}

From source file:de.sanandrew.mods.claysoldiers.client.render.entity.mount.RenderHorseMount.java

License:Creative Commons License

@Override
protected void preRenderCallback(EntityLivingBase livingBase, float partTicks) {
    GL11.glTranslatef(0.0F, 0.36F, 0.0F);
    GL11.glScalef(0.5F, 0.5F, 0.5F);
}