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:gravestone.models.block.graves.ModelHorseGraveStone.java

License:LGPL

@Override
public void renderAll() {
    this.pedestal.render(0.0625F);
    this.pedestal2.render(0.0625F);

    float horseSize = 0.7F;

    GL11.glPushMatrix();//from   w  w w .j ava  2  s  . com
    GL11.glTranslatef(0, 0.75F, 0.5F);
    GL11.glScalef(horseSize, horseSize, horseSize);
    GL11.glTranslatef(0, 1.35F * (1 - horseSize), 0);

    this.neck.render(0.0625F);
    this.mane.render(0.0625F);
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glTranslatef(0, 0.75F, 0.5F);
    float f8 = 0.5F + horseSize * horseSize * 0.5F;
    GL11.glScalef(f8, f8, f8);
    GL11.glTranslatef(0, 1.35F * (1 - horseSize), 0);

    this.mouthTop.rotationPointY = 0.02F;
    this.mouthBottom.rotationPointY = 0;

    this.mouthTop.rotationPointZ = 0.02F;
    this.mouthBottom.rotationPointZ = 0;

    this.mouthTop.rotateAngleX = 0;
    this.mouthBottom.rotateAngleX = 0;

    this.mouthTop.rotateAngleY = 0;
    this.mouthBottom.rotateAngleY = 0;

    this.horseLeftEar.render(0.0625F);
    this.horseRightEar.render(0.0625F);
    this.head.render(0.0625F);

    GL11.glPopMatrix();
}

From source file:gravestone.models.block.memorials.ModelCreeperStatueMemorial.java

License:LGPL

private void renderCreeperCharging() {
    float tickModifier = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 48.0F;
    float scale = 1.2F;
    float f4 = 0.5F;

    GL11.glTranslated(0, -0.5, 0);/*from  w  w w. j ava 2  s  . com*/
    GL11.glScalef(scale, scale, scale);
    TileEntityGSMemorialRenderer.instance.bindTextureByName(Resources.CREEPER_AURA);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
    GL11.glMatrixMode(GL11.GL_TEXTURE);

    for (int var21 = 0; var21 < 3; ++var21) {
        GL11.glLoadIdentity();
        float var23 = tickModifier * (0.001F + (float) var21 * 0.0015F) * 15;
        GL11.glTranslatef(0, var23, 0);
        renderCreeper();
    }

    GL11.glMatrixMode(GL11.GL_TEXTURE);
    GL11.glLoadIdentity();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);

    GL11.glTranslated(0, -0.19, 0);
}

From source file:gravestone.models.block.memorials.ModelSteveStatueMemorial.java

License:LGPL

private void renderArmor(ResourceLocation armorTexture) {
    pedestal.shiftModel();/* w  w w.  ja  va  2 s  .c  o m*/
    if (armorTexture != null) {
        float scale = 1.1F;
        GL11.glScalef(scale, scale, scale);
        TileEntityGSMemorialRenderer.instance.bindTextureByName(armorTexture);
        renderSteve();
    }
}

From source file:gravestone.models.block.ModelCandle.java

License:LGPL

public void renderAll() {
    Candle.render(0.0625F);

    GL11.glPushMatrix();
    GL11.glScalef(0.5F, 1, 0.5F);
    Thread.render(0.0625F);
    GL11.glPopMatrix();
}

From source file:gravestone.models.block.ModelGraveStone.java

License:LGPL

protected void renderEnchantment() {
    float tickModifier = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 48.0F;
    TileEntityGSGraveStoneRenderer.instance.bindTextureByName(Resources.SWORD_AURA);

    GL11.glEnable(GL11.GL_BLEND);//from  www .j  a  v  a2s.c o  m
    GL11.glDepthMask(true);
    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
    GL11.glMatrixMode(GL11.GL_TEXTURE);

    for (int var21 = 0; var21 < 3; var21++) {
        GL11.glDisable(GL11.GL_LIGHTING);
        float var22 = 0.76F;
        GL11.glColor4f(0.5F * var22, 0.25F * var22, 0.8F * var22, 1.0F);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glLoadIdentity();
        float var23 = tickModifier * (0.001F + (float) var21 * 0.0015F) * 15;
        float var24 = 0.33333334F;
        GL11.glScalef(var24, var24, var24);
        GL11.glRotatef(30 - (float) var21 * 60, 0, 0, 1);
        GL11.glTranslatef(0, var23, 0);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        renderAll();
    }

    GL11.glMatrixMode(GL11.GL_TEXTURE);
    GL11.glDepthMask(true);
    GL11.glLoadIdentity();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
}

From source file:gravestone.renderer.entity.RenderUndeadCat.java

License:LGPL

/**
 * Pre-Renders the Ocelot./*w w  w  .  ja v a2 s. c  om*/
 */
protected void preRenderUndeadCat(EntityUndeadCat undeadCat, float par2) {
    super.preRenderCallback(undeadCat, par2);
    GL11.glScalef(0.8F, 0.8F, 0.8F);
}

From source file:gravestone.renderer.tileentity.TileEntityGSCandleRenderer.java

License:LGPL

public void renderTileEntityCandleAt(TileEntityGSCandle tileEntity, float x, float y, float z, float par8) {
    this.bindTexture(Resources.CANDLE);

    GL11.glPushMatrix();// ww  w. ja v a2  s.  com
    if (tileEntity.getWorld() == null) {
        GL11.glTranslatef(x + 0.5F, y + 3.7F, z + 0.5F);
        GL11.glScalef(2.5F, -2.5F, -2.5F);
    } else {
        GL11.glTranslatef(x + 0.5F, y + 1.5F, z + 0.5F);
        GL11.glScalef(1, -1, -1);
    }
    GL11.glRotatef(0, 0, 1, 0);

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

From source file:gravestone.renderer.tileentity.TileEntityGSGraveStoneRenderer.java

License:LGPL

@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f, int par9) {
    TileEntityGSGraveStone tileEntity = (TileEntityGSGraveStone) te;
    EnumGraves graveType = tileEntity.getGraveType();
    int meta = 0;
    if (tileEntity.getWorld() != null) {
        meta = tileEntity.getBlockMetadata();
    }//from w  w w.j  a  va 2s. c om
    EnumFacing facing = EnumFacing.values()[meta];

    //texture
    GL11.glPushMatrix();

    if (tileEntity.getWorld() == null && tileEntity.isSwordGrave()) {
        GL11.glTranslatef((float) x + 0.5F, (float) y + 2, (float) z + 0.5F);
        GL11.glScalef(1.5F, -1.5F, -1.5F);
    } else {
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
        GL11.glScalef(1, -1, -1);
    }

    switch (facing) {
    case SOUTH:
        GL11.glRotatef(0, 0, 1, 0);
        break;
    case WEST:
        GL11.glRotatef(90, 0, 1, 0);
        break;
    case NORTH:
        GL11.glRotatef(180, 0, 1, 0);
        break;
    case EAST:
        GL11.glRotatef(270, 0, 1, 0);
        break;
    }

    if (tileEntity.isSwordGrave()) {
        renderSword(tileEntity);
    } else {
        ModelGraveStone model = getModel(graveType.getGraveType());

        bindTextureByName(getTexture(graveType, graveType.getTexture(), tileEntity.isMossy()));
        if (tileEntity.isEnchanted()) {
            model.renderEnchanted();
        } else {
            model.renderAll();
        }

        if (tileEntity.hasFlower()) {
            renderFlower(tileEntity);
        }
    }

    GL11.glPopMatrix();
}

From source file:gravestone.renderer.tileentity.TileEntityGSGraveStoneRenderer.java

License:LGPL

private void renderSword(TileEntityGSGraveStone te) {
    ItemStack sword = te.getSword();/*from  w ww.j  a v  a  2s . co  m*/
    if (te.isEnchanted()) {
        if (!sword.isItemEnchanted()) {
            if (!sword.hasTagCompound()) {
                sword.setTagCompound(new NBTTagCompound());
            }
            sword.getTagCompound().setTag("ench", new NBTTagList());
        }
    }
    EntityItem entityitem = new EntityItem(te.getWorld(), 0, 0, 0, sword);
    entityitem.hoverStart = 0;
    GL11.glTranslatef(-0.37F, 0.83F, 0);
    GL11.glScalef(1.5F, -1.5F, -1.5F);
    GL11.glRotatef(225, 0, 0, 1);

    Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityitem, 0, 0, 0, 0, 0);
}

From source file:gravestone.renderer.tileentity.TileEntityGSGraveStoneRenderer.java

License:LGPL

private void renderFlower(TileEntityGSGraveStone te) {
    EntityItem entityitem = new EntityItem(te.getWorld(), 0, 0, 0, te.getFlower());
    entityitem.hoverStart = 0;/*w  ww .ja  va2  s  .  c  om*/
    GL11.glTranslatef(0, 1.6F, -0.1F);
    GL11.glScalef(1, -1, -1);
    GL11.glRotatef(45, 0, 1, 0);

    Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityitem, 0, 0, 0, 0, 0);

    GL11.glRotatef(-90, 0, 1, 0);
    Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityitem, 0, 0, 0, 0, 0);
}