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:io.cyb3rwarri0r8.commumod.entity.render.RenderSuperbiumGolem.java

License:Open Source License

protected void renderEquippedItems(EntitySuperbiumGolem p_77029_1_, float p_77029_2_) {
    //        super.renderEquippedItems(p_77029_1_, p_77029_2_);

    if (p_77029_1_.getHoldRoseTick() != 0) {
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glPushMatrix();/*from w  w  w  .  j  a va  2s .  c o  m*/
        GL11.glRotatef(
                5.0F + 180.0F * this.superbiumGolemModel.superbiumGolemRightArm.rotateAngleX / (float) Math.PI,
                1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F);
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        float f1 = 0.8F;
        GL11.glScalef(f1, -f1, f1);
        int i = p_77029_1_.getBrightnessForRender(p_77029_2_);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindTexture(TextureMap.locationBlocksTexture);
        //            this.(Blocks.red_flower, 0, 1.0F);
        GL11.glPopMatrix();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }
}

From source file:io.github.javamatrix.randomtech.renderers.RenderSmithy.java

@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
    // Grab the cast-down entity.
    TileSmithy smithy = (TileSmithy) te;

    // First we'll render the metal.
    if (smithy.state == 1) {
        ResourceLocation texture = new ResourceLocation("This is just so Eclipse doesn't freak.");

        if (smithy.metalType == 1) {
            texture = new ResourceLocation("randomtech", "textures/blocks/oreCubeIron.png");
        } else if (smithy.metalType == 2) {
            texture = new ResourceLocation("randomtech", "textures/blocks/oreCubeGold.png");
        } else if (smithy.metalType == 3) {
            texture = new ResourceLocation("randomtech", "textures/blocks/oreCubeNullium.png");
        }/*from w ww  .j av  a2s  . c  om*/

        ModelOreCube model = new ModelOreCube();

        boolean airAbove = smithy.getWorldObj().getBlock(smithy.xCoord, smithy.yCoord + 1, smithy.zCoord)
                .getMaterial() == Material.air;

        GL11.glPushMatrix();
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
        Minecraft.getMinecraft().renderEngine.bindTexture(texture);
        GL11.glPushMatrix();

        GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
        if (!airAbove) {
            GL11.glScalef(0.75f, 0.75f, 0.75f);
            GL11.glTranslatef(0.0f, 3.0f / 16.0f, 0.0f);
        }

        float maxProgress = 200.0f;

        if (smithy.metalType == 3) {
            // Nullium takes longer to melt.
            maxProgress = 600.0f;
        }

        float p = smithy.getProgress() / maxProgress;
        GL11.glColor3f(1, 1 - p / 1.5F, 1 - p);
        model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
        GL11.glColor3f(1, 1, 1);
        GL11.glPopMatrix();
        GL11.glPopMatrix();
    } else if (smithy.state == 2) {
        GL11.glPushMatrix();
        float var10 = (float) (x - 0.5F);
        float var11 = (float) (y - 0.5F);
        float var12 = (float) (z - 0.5F);
        GL11.glTranslatef(var10, var11 + 0.05f, var12);
        renderItem(smithy, new ItemStack(RandomTechItems.moltenIngot));
        GL11.glPopMatrix();
    } else if (smithy.state == 3) {
        GL11.glPushMatrix();
        float var10 = (float) (x - 0.5F);
        float var11 = (float) (y - 0.5F);
        float var12 = (float) (z - 0.5F);
        GL11.glTranslatef(var10, var11 + 0.05f, var12);
        if (smithy.metalType == 1) {
            renderItem(smithy, new ItemStack(RandomTechItems.hardenedMetalIngot));
        } else if (smithy.metalType == 2) {
            renderItem(smithy, new ItemStack(RandomTechItems.hardenedMagicalIngot));
        }
        GL11.glPopMatrix();
    }
}

From source file:io.github.javamatrix.randomtech.renderers.RenderSmithy.java

void renderItem(TileSmithy smithy, ItemStack stack) {
    FancyEntityItem entityitem = new FancyEntityItem(smithy.getWorldObj(), stack);
    entityitem.getEntityItem().stackSize = 1;
    entityitem.hoverStart = 0.0F;/*  w ww.  j av  a  2  s  .c o  m*/
    GL11.glPushMatrix();
    GL11.glTranslatef(1F, 1.5F, 0.6F);
    GL11.glRotatef(90F, 1, 0F, 0F);
    GL11.glScalef(1.8F, 1.8F, 1.8F);
    if (stack.getItem() instanceof ItemBlock) {
        GL11.glRotatef(90F, -1, 0F, 0F);
        GL11.glTranslatef(0F, -0.1F, 0.2275F);
    }

    RenderItem.renderInFrame = true;
    RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
    RenderItem.renderInFrame = false;

    GL11.glPopMatrix();
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static void glScalef(float x, float y, float z) {
    GL11.glScalef(x, y, z);
}

From source file:ion2d.INNode.java

License:Open Source License

/**
 * Applies the transformation for the current node
 *//*  w w w. ja  v  a2 s. c o  m*/
public void transform() {
    GL11.glMultMatrix(INMath.AffineToGL(this.nodeToParentTransform()));

    if (this.vertexZ >= 0 || this.vertexZ <= 0) {
        GL11.glTranslatef(0, 0, this.vertexZ);
    }

    if (this.camera != null && !(this.grid != null && this.grid.getActive())) {
        boolean translate = (this.anchorPointInPixel.x != 0.0f || this.anchorPointInPixel.y != 0.0f);

        if (translate) {
            GL11.glTranslatef(this.anchorPointInPixel.x, this.anchorPointInPixel.y, 0);
        }

        this.camera.locate();

        if (translate) {
            GL11.glTranslatef(-this.anchorPointInPixel.x, -this.anchorPointInPixel.y, 0);
        }
    } else {
        if (this.isRelativeAnchorePoint && (this.anchorPointInPixel.x != 0 || this.anchorPointInPixel.y != 0)) {
            GL11.glTranslatef(-this.anchorPointInPixel.x, -this.anchorPointInPixel.y, 0);
        }

        if (this.anchorPointInPixel.x != 0 || this.anchorPointInPixel.y != 0) {
            GL11.glTranslatef(this.position.x + this.anchorPointInPixel.x,
                    this.position.y + this.anchorPointInPixel.y, this.vertexZ);
        } else if (this.position.x != 0 || this.position.y != 0 || this.vertexZ != 0) {
            GL11.glTranslatef(this.position.x, this.position.y, this.vertexZ);
        }

        if (this.rotation != 0.0f) {
            GL11.glRotatef(-this.rotation, 0.0f, 0.0f, 1.0f);
        }

        if (this.scaleX != 1.0f || this.scaleY != 1.0f) {
            GL11.glScalef(this.scaleX, this.scaleY, 1.0f);
        }

        if (this.camera != null && !(this.grid != null && this.grid.getActive())) {
            this.camera.locate();
        }

        if (this.anchorPointInPixel.x != 0.0f || this.anchorPointInPixel.y != 0.0f) {
            GL11.glTranslatef(-this.anchorPointInPixel.x, -this.anchorPointInPixel.y, 0);
        }
    }
}

From source file:ivorius.ivtoolkit.items.IvItemRendererModel.java

License:Apache License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    GL11.glPushMatrix();/*from   ww  w . j ava  2  s. c  o  m*/

    if (type == ItemRenderType.ENTITY)
        GL11.glTranslated(0.0, 1.0, 0.0);
    else if (type == ItemRenderType.INVENTORY)
        GL11.glTranslated(0.0, 0.3, 0.0);
    else
        GL11.glTranslated(0.5, 1.0, 0.5);

    GL11.glTranslatef(translation[0], translation[1] + 1.0f, translation[2]);

    if (type != ItemRenderType.ENTITY) {
        float modelScale = 1.0f / modelSize;
        GL11.glScalef(modelScale, modelScale, modelScale);
    }

    GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
    GL11.glRotatef(rotation[0], 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(rotation[1], 0.0f, 1.0f, 0.0f);
    GL11.glRotatef(rotation[2], 0.0f, 0.0f, 1.0f);

    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);

    Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    model.render(item);

    GL11.glPopMatrix();
}

From source file:ivorius.ivtoolkit.items.IvItemRendererModelCustom.java

License:Apache License

@Override
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
    GL11.glPushMatrix();/*from   w  w  w .  ja va 2s.c  o  m*/

    if (type == IItemRenderer.ItemRenderType.ENTITY)
        GL11.glTranslated(0.0, 1.0, 0.0);
    else if (type == IItemRenderer.ItemRenderType.INVENTORY)
        GL11.glTranslated(0.0, 0.3, 0.0);
    else
        GL11.glTranslated(0.5, 1.0, 0.5);

    GL11.glTranslatef(translation[0], translation[1] + 1.0f, translation[2]);

    if (type != IItemRenderer.ItemRenderType.ENTITY) {
        float modelScale = 1.0f / modelSize;
        GL11.glScalef(modelScale, modelScale, modelScale);
    }

    GL11.glRotatef(rotation[0], 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(rotation[1], 0.0f, 1.0f, 0.0f);
    GL11.glRotatef(rotation[2], 0.0f, 0.0f, 1.0f);

    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);

    Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    model.render(item);

    GL11.glPopMatrix();
}

From source file:kihira.minicreatures.client.model.ModelFox.java

License:Open Source License

/**
 * Renders the model based off the parameters provided. Sets rotations then calls
 * {@link net.minecraft.client.model.ModelRenderer#render(float)}
 * @param entity The entity this model is used by
 * @param f//from   w  w  w  .  j  a  va 2s  . c  om
 * @param f1
 * @param f2
 * @param f3
 * @param f4
 * @param f5 A mystery number
 */
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    EntityFox entityFox = (EntityFox) entity;
    GL11.glPushMatrix();
    if (entityFox.isSitting()) {
        GL11.glTranslatef(0.0f, f5 + 0.06f, 0f);
    }

    LBLeg.render(f5);
    head.renderWithRotation(f5);
    RBLeg.render(f5);
    RFLeg.render(f5);
    LFLeg.render(f5);
    Body.render(f5);
    tailBase.render(f5);
    if (entityFox.hasChest()) {
        GL11.glPushMatrix();
        GL11.glScalef(1f, 0.5f, 0.5f);
        if (entityFox.isSitting()) {
            GL11.glTranslatef(0.0f, 16F * f5, f5 - 0.3f);
        } else {
            GL11.glTranslatef(0.0f, 18F * f5, f5 - 0.15f);
        }
        chest.render(f5);
        GL11.glPopMatrix();
    }
    GL11.glPopMatrix();
}

From source file:kihira.minicreatures.client.model.ModelMiniPlayer.java

License:Open Source License

/**
 * Renders the model based off the parameters provided. Sets rotations then calls
 * {@link net.minecraft.client.model.ModelRenderer#render(float)}
 * @param entity The entity this model is used by
 * @param f//from   w ww .j a v  a 2  s.c  o m
 * @param f1
 * @param f2
 * @param f3
 * @param f4
 * @param f5 A mystery number
 */
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    ICustomisable miniPlayer = (ICustomisable) entity;
    GL11.glPushMatrix();
    this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    float f6 = 2.0F;
    /*
    if (entity.getCommandSenderName().equals("ArashiDragon")) {
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4d(1.0, 1.0, 1.0, 0.8);
    }
    */
    GL11.glPushMatrix();
    GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6);
    GL11.glTranslatef(0.0F, 16.0F * f5, 0.0F);
    this.bipedHead.render(f5);
    this.bipedHeadwear.render(f5);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
    GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F);
    this.bipedBody.render(f5);
    this.bipedRightArm.render(f5);
    this.bipedLeftArm.render(f5);
    this.bipedRightLeg.render(f5);
    this.bipedLeftLeg.render(f5);
    GL11.glPopMatrix();

    for (String partName : miniPlayer
            .getCurrentParts(Minecraft.getMinecraft().currentScreen instanceof GuiCustomizer)) {
        ICustomizerPart part = CustomizerRegistry.getPart(partName);
        if (part != null)
            part.render(entity, this, f, f1, f2, f3, f4, f5);
    }
    GL11.glPopMatrix();
}

From source file:kihira.minicreatures.client.model.parts.PartModelFairy.java

License:Open Source License

@Override
public void render(Entity entity, ModelBase modelMiniPlayer, float par2, float par3, float par4, float par5,
        float par6, float par7) {
    Minecraft.getMinecraft().renderEngine.bindTexture(ClientProxy.specialTextures);

    GL11.glPushMatrix();/*from  ww w. j  av  a  2 s.co  m*/
    GL11.glScalef(1.0F / 2F, 1.0F / 2F, 1.0F / 2F);
    GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
    fairy.render(par7);
    GL11.glPopMatrix();
}