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:cn.lambdacraft.mob.client.renderer.RenderBarnacle.java

License:Open Source License

@Override
public void doRender(Entity entity, double par2, double par4, double par6, float par8, float par9) {
    EntityBarnacle barnacle = (EntityBarnacle) entity;
    Tessellator t = Tessellator.instance;
    GL11.glPushMatrix();/*from   w ww  . ja v a2 s .c  o  m*/
    Minecraft.getMinecraft().renderEngine.bindTexture(ClientProps.BARNACLE_PATH);
    GL11.glTranslatef((float) par2, (float) par4 + 2 * entity.height, (float) par6);
    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    GL11.glTranslatef(0.0F, 1.5F, 0.0F);
    if (barnacle.getHealth() <= 0)
        GL11.glRotatef(barnacle.deathTime * 6.5F, 1.0F, 0.0F, -1.0F);
    GL11.glTranslatef(0.0F, -1.5F, 0.0F);
    if (barnacle.hurtResistantTime > 10)
        GL11.glColor3f(1.0F, 0.5F, 0.5F);

    this.model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    if (barnacle.getHealth() > 0) {
        //Barnacle Tentacle Render
        double length = barnacle.tentacleLength;
        double h1 = 0.5, h2 = length + 1.0;
        Vec3 v1 = RenderUtils.newV3(-WIDTH, h1, -WIDTH), v2 = RenderUtils.newV3(-WIDTH, h1, WIDTH),
                v3 = RenderUtils.newV3(WIDTH, h1, WIDTH), v4 = RenderUtils.newV3(WIDTH, h1, -WIDTH);
        Vec3 v5 = RenderUtils.newV3(-WIDTH, h1, -WIDTH), v6 = RenderUtils.newV3(-WIDTH, h2, WIDTH),
                v7 = RenderUtils.newV3(WIDTH, h2, WIDTH), v8 = RenderUtils.newV3(WIDTH, h2, -WIDTH);
        Minecraft.getMinecraft().renderEngine.bindTexture(ClientProps.BARNACLE_TENTACLE_PATH);

        t.startDrawingQuads();
        RenderUtils.addVertex(v1, 0.0, 0.0);
        RenderUtils.addVertex(v5, 0.0, length);
        RenderUtils.addVertex(v6, 1.0, length);
        RenderUtils.addVertex(v2, 1.0, 0.0);

        RenderUtils.addVertex(v2, 0.0, 0.0);
        RenderUtils.addVertex(v6, 0.0, length);
        RenderUtils.addVertex(v7, 1.0, length);
        RenderUtils.addVertex(v3, 1.0, 0.0);

        RenderUtils.addVertex(v3, 0.0, 0.0);
        RenderUtils.addVertex(v7, 0.0, length);
        RenderUtils.addVertex(v8, 1.0, length);
        RenderUtils.addVertex(v4, 1.0, 0.0);

        RenderUtils.addVertex(v4, 0.0, 0.0);
        RenderUtils.addVertex(v8, 0.0, length);
        RenderUtils.addVertex(v5, 1.0, length);
        RenderUtils.addVertex(v1, 1.0, 0.0);

        RenderUtils.addVertex(v8, 0.0, 0.0);
        RenderUtils.addVertex(v7, 0.0, 0.1);
        RenderUtils.addVertex(v6, 0.1, 0.1);
        RenderUtils.addVertex(v5, 0.1, 0.0);
        t.draw();
    }
    GL11.glColor3f(1.0F, 1.0F, 1.0F);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.mob.client.renderer.RenderTurret.java

License:Open Source License

@Override
public void doRender(Entity entity, double par2, double par4, double par6, float par8, float f1) {
    EntitySentry turret = (EntitySentry) entity;
    GL11.glPushMatrix();//from   www  . j a  va 2 s  .  co  m
    GL11.glDisable(GL11.GL_CULL_FACE);
    RenderUtils.loadTexture(ClientProps.TURRET_PATH);
    super.doRender(entity, par2, par4, par6, par8, f1);
    GL11.glTranslatef((float) par2, (float) par4 + turret.height - turret.deathTime * 0.06F, (float) par6);
    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    if (turret.hurtResistantTime > 15)
        GL11.glColor3f(1.0F, 0.3F, 0.3F);
    GL11.glRotatef(turret.deathTime * 3, 1.0F, 0.2F, -1.0F);
    GL11.glRotatef(180.0F - turret.rotationYawHead, 0.0F, 1.0F, 0.0F);
    model.renderTop(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.terrain.client.model.ModelXenAmethyst.java

License:Open Source License

@Override
public void render(TileEntity is, double x, double y, double z, float f1, float scale, float f) {
    GL11.glPushMatrix();//  ww  w . j a v  a  2s .co  m
    //      GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
    GL11.glTranslated(x + 0.5, y + 1.6, z + 0.5);
    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    RenderUtils.loadTexture(ClientProps.AMETHYST_PATH);
    Shape1.render(scale);
    Shape2.render(scale);
    Shape3.render(scale);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.terrain.client.model.ModelXenLight.java

License:Open Source License

@Override
public void render(TileEntity is, double x, double y, double z, float f1, float scale, float f) {
    TileEntityXenLight tile = (TileEntityXenLight) is;
    GL11.glPushMatrix();/*from   w w w  .  jav  a2 s. c o m*/
    GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    RenderUtils.loadTexture(ClientProps.XENLIGHT_PATH);
    Shape1.render(scale);
    //~
    GL11.glRotated(12.5 * MathHelper.sin(tile.ticksExisted * 0.07F), 0.1, 1, -0.1);
    if (tile.isLighting) {
        if (tile.tickSinceChange < 15)
            GL11.glTranslatef(0.0F, 0.0166F * (15 - tile.tickSinceChange), 0.0F);
    } else {
        if (tile.tickSinceChange < 5)
            GL11.glTranslatef(0.0F, 0.05F * tile.tickSinceChange, 0.0F);
        else
            GL11.glTranslatef(0.0F, 0.25F, 0.0F);
    }
    Shape2.render(scale);
    Shape3.render(scale);
    GL11.glPopMatrix();
}

From source file:cn.lambdalib.template.client.render.entity.RenderIcon.java

License:MIT License

@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    GL11.glEnable(GL11.GL_BLEND);//from   w w w .  j  a va 2  s .  com
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_CULL_FACE);
    if (!hasLight)
        GL11.glDisable(GL11.GL_LIGHTING);
    //GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glAlphaFunc(GL11.GL_GREATER, minTolerateAlpha);
    GL11.glPushMatrix();
    {
        GL11.glTranslatef((float) par2, (float) par4, (float) par6);
        GL11.glScalef(size, size, size);
        postTranslate(par1Entity);
        if (icon != null)
            RenderUtils.loadTexture(icon);

        Tessellator t = Tessellator.instance;
        this.func_77026_a(par1Entity, t);

    }
    GL11.glPopMatrix();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.lambdalib.template.client.render.item.RenderModelItem.java

License:MIT License

public void renderInventory() {

    GL11.glDisable(GL11.GL_CULL_FACE);// w w w  .j  a  v  a2  s  .co m
    GL11.glPushMatrix();
    {

        RenderUtils.loadTexture(texturePath);

        GL11.glTranslated(8.0F + invOffset.x, 8.0F + invOffset.y, 0.0F);
        GL11.glScaled(16F * invScale, 16F * invScale, 16F * invScale);
        float rotation = 145F;
        if (inventorySpin)
            rotation = GameTimer.getAbsTime() / 100F;
        GL11.glRotatef(rotation, 0, 1, 0);
        this.doRotation(invRotation);
        GL11.glScalef(-1F, -1F, 1F);

        renderAtStdPosition();

    }
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.lambdalib.template.client.render.item.RenderModelItem.java

License:MIT License

protected void renderAtStdPosition(float i) {
    GL11.glScaled(scale, scale, scale);//from   w  w  w. ja  v  a 2  s  .c  o m
    GL11.glDisable(GL11.GL_CULL_FACE);
    this.doTransformation(stdOffset);
    GL11.glScalef(-1F, -1F, 1F);
    GL11.glRotated(stdRotation.yCoord + 180, 0.0F, 1.0F, 0.0F);
    GL11.glRotated(stdRotation.zCoord, 0.0F, 0.0F, 1.0F);
    GL11.glRotated(stdRotation.xCoord, 1.0F, 0.0F, 0.0F);

    model.render(null, 0.0625F, i);
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.lambdalib.util.client.RenderUtils.java

License:MIT License

public static void renderOverlayEquip(ResourceLocation src) {
    //Setup//from   ww w  .  j  av a 2 s.  com
    GL11.glDepthFunc(GL11.GL_EQUAL);
    GL11.glDisable(GL11.GL_LIGHTING);
    loadTexture(src);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
    float f7 = 0.76F;
    GL11.glMatrixMode(GL11.GL_TEXTURE);
    //Push texture mat
    GL11.glPushMatrix();
    float f8 = 0.125F;
    GL11.glScalef(f8, f8, f8);
    float f9 = GameTimer.getAbsTime() % 3000L / 3000.0F * 8.0F;
    GL11.glTranslatef(f9, 0.0F, 0.0F); //xOffset loops between 0.0 and 8.0
    GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
    ItemRenderer.renderItemIn2D(t, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
    GL11.glPopMatrix();

    //Second pass
    GL11.glPushMatrix();
    GL11.glScalef(f8, f8, f8);
    f9 = GameTimer.getAbsTime() % 4873L / 4873.0F * 8.0F; //Loop between 0 and 8, longer loop
    GL11.glTranslatef(-f9, 0.0F, 0.0F); //Still xOffset
    GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); //However, different rotation!
    ItemRenderer.renderItemIn2D(t, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
    GL11.glPopMatrix();
    //Pop texture mat
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
}

From source file:cn.lambdalib.util.client.RenderUtils.java

License:MIT License

public static void renderOverlayInv(ResourceLocation src) {
    GL11.glDepthFunc(GL11.GL_EQUAL);/*  w  ww  .  ja v  a  2  s  .  co m*/
    GL11.glDisable(GL11.GL_LIGHTING);
    loadTexture(src);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
    float f7 = 0.76F;
    //GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
    GL11.glMatrixMode(GL11.GL_TEXTURE);
    GL11.glPushMatrix();
    float f8 = 0.125F;
    GL11.glScalef(f8, f8, f8);
    float f9 = GameTimer.getAbsTime() % 3000L / 3000.0F * 8.0F;
    GL11.glTranslatef(f9, 0.0F, 0.0F);
    GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
    t.startDrawingQuads();
    t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0);
    t.addVertexWithUV(0.0, 16.0, 0.0, 0.0, 1.0);
    t.addVertexWithUV(16.0, 16.0, 0.0, 1.0, 1.0);
    t.addVertexWithUV(16.0, 0.0, 0.0, 1.0, 0.0);
    t.draw();
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glScalef(f8, f8, f8);
    f9 = GameTimer.getAbsTime() % 4873L / 4873.0F * 8.0F;
    GL11.glTranslatef(-f9, 0.0F, 0.0F);
    GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
    t.startDrawingQuads();
    t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0);
    t.addVertexWithUV(0.0, 16.0, 0.0, 0.0, 1.0);
    t.addVertexWithUV(16.0, 16.0, 0.0, 1.0, 1.0);
    t.addVertexWithUV(16.0, 0.0, 0.0, 1.0, 0.0);
    t.draw();
    GL11.glPopMatrix();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
}

From source file:cn.lambdalib.util.deprecated.ItemModelCustom.java

License:MIT License

@Override
public void render(ItemStack is, float scale, float f) {
    GL11.glScalef(scale, scale, scale);
    theModel.renderAll();
}