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.render.entity.RenderOmotholGhoul.java

License:Apache License

/**
 * Applies the scale to the transform matrix
 *///from www .  j a  va  2s  .  c o m
protected void preRenderScale(EntityOmotholGhoul par1EntityOmotholGhoul, float par2) {
    GL11.glScalef(scale, scale, scale);
}

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

License:Apache License

protected void preRenderScale(EntitySkeletonGoliath par1EntitySkeletonGoliath, float par2) {
    GL11.glScalef(scale, scale, scale);
}

From source file:com.shinoow.abyssalcraft.client.render.item.RenderCudgel.java

License:Apache License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) {
        GL11.glPushMatrix();/*from   w w w  .  j  a  v  a 2  s .  c  o m*/

        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);

        GL11.glRotatef(90F, 1.0F, 1.0F, -0.5F);

        if (type == ItemRenderType.EQUIPPED)
            GL11.glTranslatef(0.75F, -0.1F, 0.1F);
        else
            GL11.glTranslatef(0.61F, 0.0F, 0.0F);

        float scale = 1.1F;
        GL11.glScalef(scale, scale, scale);

        model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

        GL11.glPopMatrix();
    }
    if (type == ItemRenderType.ENTITY) {

        GL11.glPushMatrix();
        float scale = 1.5F;
        GL11.glScalef(scale, scale, scale);
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);
        GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(90F, 0.0f, 1.0f, 0.0f);
        GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f);
        GL11.glTranslatef(0.5F, -0.5F, 0.1F);
        model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
        GL11.glPopMatrix();

    }
    if (type == ItemRenderType.INVENTORY) {
        GL11.glPushMatrix();
        float scale = 1.0F;
        GL11.glScalef(scale, scale, scale);
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);

        GL11.glRotatef(80F, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f);
        GL11.glTranslatef(0.0F, 0.0F, 0F);
        model.render(0.0625F);
        GL11.glPopMatrix();
    }
}

From source file:com.shinoow.abyssalcraft.client.render.item.RenderHilt.java

License:Apache License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) {
        GL11.glPushMatrix();/*w ww . j  a v  a 2 s . c  o m*/

        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);

        GL11.glRotatef(90F, 1.0F, 1.0F, -0.5F);

        if (type == ItemRenderType.EQUIPPED)
            GL11.glTranslatef(0.75F, -0.1F, 0.1F);
        else
            GL11.glTranslatef(0.61F, 0.0F, 0.0F);

        float scale = 1.1F;
        GL11.glScalef(scale, scale, scale);

        model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

        GL11.glPopMatrix();
    }
    if (type == ItemRenderType.ENTITY) {

        GL11.glPushMatrix();
        float scale = 1.5F;
        GL11.glScalef(scale, scale, scale);
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);
        GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(90F, 0.0f, 1.0f, 0.0f);
        GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f);
        GL11.glTranslatef(0.5F, -0.5F, 0.1F);
        model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
        GL11.glPopMatrix();

    }
    if (type == ItemRenderType.INVENTORY) {
        GL11.glPushMatrix();
        float scale = 1.0F;
        GL11.glScalef(scale, scale, scale);
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);

        GL11.glRotatef(80F, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f);
        GL11.glTranslatef(0.2F, 0.0F, -0.2F);
        model.render(0.0625F);
        GL11.glPopMatrix();
    }
}

From source file:com.shinoow.abyssalcraft.client.render.item.RenderStaff.java

License:Apache License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) {
        GL11.glPushMatrix();/*from w  w w  .j a va2s.  c om*/

        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);

        GL11.glRotatef(170F, 1.0F, 0.4F, -0.5F);

        if (type == ItemRenderType.EQUIPPED)
            GL11.glTranslatef(0.41F, -0.4F, -0.55F);
        else
            GL11.glTranslatef(0.61F, -0.4F, -0.55F);

        float scale = 1.1F;
        GL11.glScalef(scale, scale, scale);

        model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

        GL11.glPopMatrix();
    }
    if (type == ItemRenderType.ENTITY) {

        GL11.glPushMatrix();
        float scale = 1.5F;
        GL11.glScalef(scale, scale, scale);
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);
        GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(0F, 0.0f, 1.0f, 0.0f);
        GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f);
        GL11.glTranslatef(0.1F, -0.5F, 0.1F);
        model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
        GL11.glPopMatrix();

    }
    if (type == ItemRenderType.INVENTORY) {
        GL11.glPushMatrix();
        float scale = 1.0F;
        GL11.glScalef(scale, scale, scale);
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource);

        GL11.glRotatef(80F, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f);
        GL11.glTranslatef(0.0F, 0.0F, 0F);
        model.render(0.0625F);
        GL11.glPopMatrix();
    }
}

From source file:com.sijobe.console.GuiConsole.java

License:Open Source License

/**
 * Draws the specified String flipped upside down
 *
 * @param fontrenderer//from   w  ww . j  a  va 2s  .  c o  m
 * @param s string to draw
 * @param i position of the x coordinate
 * @param j position of the y coordinate
 * @param k colour of the render
 * @param flag if true draw with shadow, if false draw without shadow
 */

public void drawStringFlipped(FontRenderer fontrenderer, String s, int i, int j, int k, boolean flag) {
    GL11.glPushMatrix();
    GL11.glScalef(-1F, -1F, 1F);
    GL11.glTranslatef((-i * 2) - fontrenderer.getStringWidth(s), (-j * 2) - fontrenderer.FONT_HEIGHT, 0.0F);
    if (flag) {
        fontrenderer.drawString(s, i - 1, j - 1, (k & 0xfcfcfc) >> 2 | k & 0xff000000); //Took the last argument from FrontRenderer.renderString() because it's private and I want the shadow on the correct side when flipped
    }
    fontrenderer.drawString(s, i, j, k);
    GL11.glPopMatrix();
}

From source file:com.spawck.hs2.client.renderer.model.ModelSoul.java

License:GNU General Public License

@Override
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    GL11.glPushMatrix();//from  www.ja v a2  s . co m
    GL11.glScalef(1.0F, 1.0F, 1.0F);
    GL11.glTranslatef(0.0F, -0.5F, 0.0F);

    if (this.base != null) {
        this.base.render(par7);
    }

    GL11.glEnable(2977);
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    this.glass.render(par7);
    float var8 = 0.875F;
    GL11.glScalef(var8, var8, var8);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    this.glass.render(par7);
    GL11.glScalef(var8, var8, var8);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    this.cube.render(par7);
    GL11.glDepthFunc(514);
    GL11.glDisable(2896);
    GL11.glEnable(3042);
    GL11.glBlendFunc(768, 1);
    float var14 = 0.76F;
    GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F);
    GL11.glMatrixMode(5890);
    GL11.glPushMatrix();
    float var15 = 0.125F;
    GL11.glScalef(var15, var15, var15);
    float var16 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
    GL11.glTranslatef(var16, 0.0F, 0.0F);
    GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
    this.cube.render(par7);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glScalef(var15, var15, var15);
    var16 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
    GL11.glTranslatef(-var16, 0.0F, 0.0F);
    GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
    this.cube.render(par7);
    GL11.glPopMatrix();
    GL11.glMatrixMode(5888);
    GL11.glDisable(3042);
    GL11.glEnable(2896);
    GL11.glDepthFunc(515);
    GL11.glPopMatrix();
}

From source file:com.sriramramani.droid.inspector.ui.InspectorCanvas.java

License:Mozilla Public License

private void doPaint() {
    if (isDisposed() || mNode == null) {
        return;// ww  w .  j  a  v a  2 s .c om
    }

    setCurrent();

    // Clear the color, depth and stencil buffers.
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);

    GL11.glLoadIdentity();

    GLU.gluLookAt(0.0f, 0.0f, mCamera.z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

    // Transformations happen in the reverse.
    if (mIsOrtho) {
        // User's translation.
        GL11.glTranslatef(mOrthoTranslate.x, mOrthoTranslate.y, 0.0f);

        // Rotate 180 degrees.
        GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f);

        // Center the nodes.
        final Rectangle bounds = getBounds();
        final float scaledWidth = mNode.bounds.width * mOrthoScale;
        final float scaledHeight = mNode.bounds.height * mOrthoScale;
        GL11.glTranslatef((bounds.width - scaledWidth) / 2, 0.0f, 0.0f);

        // Scale based on viewport size.
        GL11.glTranslatef(scaledWidth / 2, -scaledHeight / 2, 0.0f);
        GL11.glScalef(mOrthoScale, mOrthoScale, 0.0f);
        GL11.glTranslatef(-scaledWidth / 2, scaledHeight / 2, 0.0f);

    } else {
        // Translate all the nodes.
        GL11.glTranslatef(mTranslate.x, mTranslate.y, 0.0f);

        // Rotate.
        GL11.glRotatef(mRotate.x, 1.0f, 0.0f, 0.0f);
        GL11.glRotatef(mRotate.y, 0.0f, 1.0f, 0.0f);

        // Center the nodes.
        GL11.glTranslatef(-mNode.bounds.width / 2, mNode.bounds.height / 2, 0.0f);
    }

    final float absX = Math.abs(mRotate.x);
    final float absY = Math.abs(mRotate.y);
    mDepth = Math.max(absX, absY) * 5 / 9.0f;

    drawHierarchy(mNode);

    if (!mIsPicking && mIsOrtho && mShowOverdraw) {
        for (int i = 2; i <= 5; i++) {
            drawOverdraw(i);
        }
    }

    GL11.glFlush();

    if (!mIsPicking) {
        swapBuffers();
    }
}

From source file:com.stormister.rediscovered.RenderBlockChair.java

License:Open Source License

@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -1.5F, -0.5F);
    GL11.glScalef(1.0F, 1.0F, 1.0F);
    TileEntityRendererDispatcher.instance.renderTileEntityAt(this.egg, 0.0D, 1.0D, 0.0D, 0.0F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}

From source file:com.stormister.rediscovered.RenderBlockLecternOpen.java

License:Open Source License

@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -3.0F, -0.5F);
    GL11.glScalef(1.0F, 1.0F, 1.0F);
    TileEntityRendererDispatcher.instance.renderTileEntityAt(this.egg, 0.0D, 1.0D, 0.0D, 0.0F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}