Example usage for org.lwjgl.opengl GL11 glScaled

List of usage examples for org.lwjgl.opengl GL11 glScaled

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glScaled.

Prototype

public static native void glScaled(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y,
        @NativeType("GLdouble") double z);

Source Link

Document

Double version of #glScalef Scalef .

Usage

From source file:com.dyonovan.neotech.pipes.entities.ItemResourceEntity.java

License:Creative Commons License

@Override
public void renderResource(float tickPartial) {
    GlStateManager.pushMatrix();/*from w w  w . ja  v a 2  s  . co m*/
    GlStateManager.pushAttrib();

    RenderManager manager = Minecraft.getMinecraft().getRenderManager();
    GL11.glTranslated(xPos - manager.renderPosX, yPos - manager.renderPosY, zPos - manager.renderPosZ);
    RenderUtils.bindMinecraftBlockSheet();
    GL11.glScaled(0.5, 0.5, 0.5);
    try {
        Minecraft.getMinecraft().getRenderItem().renderItemModel(resource);
    } catch (NullPointerException ignored) {
    }

    GlStateManager.popAttrib();
    GlStateManager.popMatrix();
}

From source file:com.eagle.adventurersalchemy.model.AlchemicalFireModel.java

License:Open Source License

@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    GL11.glPushMatrix();/*from   w  w  w  . j a v  a 2 s .  c om*/
    GL11.glTranslatef(this.frontBorder.offsetX, this.frontBorder.offsetY, this.frontBorder.offsetZ);
    GL11.glTranslatef(this.frontBorder.rotationPointX * f5, this.frontBorder.rotationPointY * f5,
            this.frontBorder.rotationPointZ * f5);
    GL11.glScaled(1.0D, 0.8D, 1.0D);
    GL11.glTranslatef(-this.frontBorder.offsetX, -this.frontBorder.offsetY, -this.frontBorder.offsetZ);
    GL11.glTranslatef(-this.frontBorder.rotationPointX * f5, -this.frontBorder.rotationPointY * f5,
            -this.frontBorder.rotationPointZ * f5);
    this.frontBorder.render(f5);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glTranslatef(this.rightBorder.offsetX, this.rightBorder.offsetY, this.rightBorder.offsetZ);
    GL11.glTranslatef(this.rightBorder.rotationPointX * f5, this.rightBorder.rotationPointY * f5,
            this.rightBorder.rotationPointZ * f5);
    GL11.glScaled(1.0D, 0.8D, 1.0D);
    GL11.glTranslatef(-this.rightBorder.offsetX, -this.rightBorder.offsetY, -this.rightBorder.offsetZ);
    GL11.glTranslatef(-this.rightBorder.rotationPointX * f5, -this.rightBorder.rotationPointY * f5,
            -this.rightBorder.rotationPointZ * f5);
    this.rightBorder.render(f5);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glTranslatef(this.backBorder.offsetX, this.backBorder.offsetY, this.backBorder.offsetZ);
    GL11.glTranslatef(this.backBorder.rotationPointX * f5, this.backBorder.rotationPointY * f5,
            this.backBorder.rotationPointZ * f5);
    GL11.glScaled(1.0D, 0.8D, 1.0D);
    GL11.glTranslatef(-this.backBorder.offsetX, -this.backBorder.offsetY, -this.backBorder.offsetZ);
    GL11.glTranslatef(-this.backBorder.rotationPointX * f5, -this.backBorder.rotationPointY * f5,
            -this.backBorder.rotationPointZ * f5);
    this.backBorder.render(f5);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glTranslatef(this.leftBorder.offsetX, this.leftBorder.offsetY, this.leftBorder.offsetZ);
    GL11.glTranslatef(this.leftBorder.rotationPointX * f5, this.leftBorder.rotationPointY * f5,
            this.leftBorder.rotationPointZ * f5);
    GL11.glScaled(1.0D, 0.8D, 1.0D);
    GL11.glTranslatef(-this.leftBorder.offsetX, -this.leftBorder.offsetY, -this.leftBorder.offsetZ);
    GL11.glTranslatef(-this.leftBorder.rotationPointX * f5, -this.leftBorder.rotationPointY * f5,
            -this.leftBorder.rotationPointZ * f5);
    this.leftBorder.render(f5);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glTranslatef(this.pit.offsetX, this.pit.offsetY, this.pit.offsetZ);
    GL11.glTranslatef(this.pit.rotationPointX * f5, this.pit.rotationPointY * f5, this.pit.rotationPointZ * f5);
    GL11.glScaled(1.0D, 0.5D, 1.0D);
    GL11.glTranslatef(-this.pit.offsetX, -this.pit.offsetY, -this.pit.offsetZ);
    GL11.glTranslatef(-this.pit.rotationPointX * f5, -this.pit.rotationPointY * f5,
            -this.pit.rotationPointZ * f5);
    this.pit.render(f5);
    GL11.glPopMatrix();
}

From source file:com.endreman0.souleater.client.gui.GuiInfoBook.java

License:Creative Commons License

@Override
public void drawScreen(int mouseX, int mouseY, float f) {
    drawDefaultBackground();//Dark filter over world, like in inventory and options

    GL11.glPushMatrix();//This starts GL drawing.
    mc.renderEngine.bindTexture(texture);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glScaled(scale, scale, scale);
    drawTexturedModalRect((int) ((width / 2 - (128 * scale)) * 2 / 3), (int) (height / 2 - (67 * scale)), 0, 0,
            256, 135);//from   w  w  w.  j a v a2s  .c o  m
    GL11.glPopMatrix();//Pushing and popping prevents you having to undo all of the translates, rotates and scales

    String[] thisPage = text[2 * page];
    for (int i = 0; i < thisPage.length; i++) {
        fontRendererObj.drawString(thisPage[i],
                x1 + guiWidth / 4 - fontRendererObj.getStringWidth(thisPage[i]) / 2,
                (int) (height * 0.23 + fontRendererObj.FONT_HEIGHT * i), 0x000000, false);
    }
    if (2 * page < lengthPages - 1) {
        thisPage = text[2 * page + 1];
        for (int i = 0; i < thisPage.length; i++) {
            fontRendererObj.drawString(thisPage[i],
                    x1 + guiWidth * 3 / 4 - fontRendererObj.getStringWidth(thisPage[i]) / 2,
                    (int) (height * 0.23 + fontRendererObj.FONT_HEIGHT * i), 0x000000, false);
        }
    }

    super.drawScreen(mouseX, mouseY, f);//Draws buttons and labels
}

From source file:com.farincorporated.frameutils.client.rendering.FramePistonRenderer.java

@Override
public void renderTileEntityAt(TileEntity ti, double x, double y, double z, float timeSinceLastTick) {
    TileFramePiston tile = (TileFramePiston) ti;
    ResourceLocation framemap = super.getFrame(tile.getMaterialType());
    GL11.glDisable(GL11.GL_CULL_FACE);//www.jav  a2  s  . c om

    GL11.glPushMatrix();
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    GL11.glScaled(scale, scale, scale);

    double[] dir = this.directionRotate(tile.getFace());
    GL11.glRotated(dir[0], dir[1], dir[2], dir[3]);

    this.renderPistonBase(framemap);

    if (tile.isStill()) {
        GL11.glPushMatrix();
        this.bindTexture(this.pistonmap);
        modelpiston.renderPart("pistsontop");
        GL11.glPopMatrix();
        GL11.glPopMatrix();
    } else {
        GL11.glPopMatrix();
        GL11.glPushMatrix();

        this.TranslateModel(x, y, z, tile.getFace(), tile.getProgress());

        GL11.glScaled(scale, scale, scale);
        GL11.glRotated(dir[0], dir[1], dir[2], dir[3]);

        GL11.glPushMatrix();
        this.bindTexture(framemap);
        this.modelpistonext.renderPart("outterframe");
        GL11.glPopMatrix();

        GL11.glPushMatrix();
        this.bindTexture(framemap);
        this.modelpistonext.renderPart("innerframe");
        GL11.glPopMatrix();

        GL11.glPushMatrix();
        this.bindTexture(pistonmap);
        this.modelpistonext.renderPart("shaft");
        GL11.glPopMatrix();

        GL11.glPushMatrix();
        this.bindTexture(pistonmap);
        this.modelpistonext.renderPart("face");
        GL11.glPopMatrix();

        GL11.glPopMatrix();
    }

}

From source file:com.farincorporated.frameutils.client.rendering.FramePistonRenderer.java

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    //RenderBlocks render = (RenderBlocks) data[0];
    GL11.glDisable(GL11.GL_CULL_FACE);/*from   www.j  a v a2  s.  c  om*/
    GL11.glPushMatrix();
    GL11.glScaled(scale, scale, scale);
    double[] dir = this.directionRotate(1);
    GL11.glRotated(dir[0], dir[1], dir[2], dir[3]);
    this.renderPistonBase(this.frametextures
            .get(item.hasTagCompound() ? item.getTagCompound().getString("frame_material") : "wood"));

    GL11.glPushMatrix();
    this.bindTexture(this.pistonmap);
    modelpiston.renderPart("pistsontop");
    GL11.glPopMatrix();

    GL11.glPopMatrix();
}

From source file:com.farincorporated.frameutils.client.rendering.FrameTranslaterRenderer.java

@Override
public void renderTileEntityAt(TileEntity ti, double x, double y, double z, float timesincelasttick) {
    TileFrameTranslater tile = (TileFrameTranslater) ti;
    ResourceLocation framemap = super.getFrame(tile.getMaterialType());
    GL11.glDisable(GL11.GL_CULL_FACE);/*from   w  w w. j  a v  a2  s.  c  om*/
    GL11.glColor3d(1.0, 1.0, 1.0);
    GL11.glPushMatrix();
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    GL11.glScaled(scale, scale, scale);
    double[] dir = this.directionRotate(tile.getFace());
    GL11.glRotated(dir[0], dir[1], dir[2], dir[3]);
    this.renderTranslater(framemap);
    GL11.glPopMatrix();
}

From source file:com.farincorporated.frameutils.client.rendering.FrameTranslaterRenderer.java

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    GL11.glDisable(GL11.GL_CULL_FACE);// w  w  w.j ava2  s. c o m
    GL11.glPushMatrix();
    GL11.glScaled(scale, scale, scale);
    this.renderTranslater(
            super.getFrame(item.hasTagCompound() ? item.getTagCompound().getString("frame_material") : "wood"));
    GL11.glPopMatrix();
}

From source file:com.fr3gu.letsmod.client.RenderSpaceship.java

License:LGPL

public void renderSpaceship(EntitySpaceship spaceship, double x, double y, double z, float yaw,
        float partialTickTime) {
    GL11.glPushMatrix();/*from ww w  . j av  a2  s.  c  om*/
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glRotatef(180.0F - yaw, 0.0F, 1.0F, 0.0F);
    GL11.glScaled(-1.0F, -1.0F, 1.0F);

    func_110777_b(spaceship);

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

    GL11.glPopMatrix();
}

From source file:com.hea3ven.colladamodel.client.model.transform.Scale.java

License:Open Source License

public void apply() {
    GL11.glScaled(vec.xCoord, vec.yCoord, vec.zCoord);
}

From source file:com.kodehawa.gui.api.components.ModuleGui.java

License:Open Source License

public void makeKeybindsFrame() {
    Frame kFrame = new Frame(CheatBase.instance, 250, 10, 120, 20, 0xff550055, 0xaa000000, "Keybinds") {
        @Override/*  w w w .  j  a  va  2 s .c  o m*/
        public void update() {
            this.draw();
            this.children.clear();
            for (Mod m : CheatBase.instance.mmanager.mods) {
                Label l = new Label(m.name + " - " + Keyboard.getKeyName(m.keyBind), 0xffffff);
                l.setParent(this, (x) + 3, (y) - 21);
                addChild(l);
            }
        }

        @Override
        public void draw() {
            // TODO Auto-generated method stub

            if (color2 > -1) {
                ModGuiUtils.drawRect(x, y, x + width, y + oldHeight, color);
                ModGuiUtils.drawRect(x, y, x + width, y + oldHeight, (int) (color * 1.1));
            } else {
                ModGuiUtils.drawGradientRect(x, y, x + width, y + oldHeight, color, color2);
                ModGuiUtils.drawRect(x, y + oldHeight, x + width, y + height, color2);
            }

            /**
             * Minimize button
             */
            ModGuiUtils.drawFilledCircle((x + width) - 8, y + 7, 2.5, 0xff00dd66);
            if (minimized) {
                ModGuiUtils.drawFilledCircle((x + width) - 8, y + 7, 2.5, 0xaa000000);
            }

            if (pinnable) {
                ModGuiUtils.drawFilledCircle((x + width) - 16, y + 7, 2.5, 0xff72a9dc);
                if (pinned) {
                    ModGuiUtils.drawFilledCircle((x + width) - 16, y + 7, 2.5, 0xaa000000);
                }
            }

            ModGuiUtils.drawHorizontalLine(this.x + 2, (this.x + this.width) - 2, (this.y + this.oldHeight) - 6,
                    2, 0xff550055);

            CheatBase.instance.minecraft.fontRenderer.drawString(this.text, this.x + 3, this.y + 3, 0xff87b5ff);

            if (minimized) {
                this.height = oldHeight;

            } else {
                this.height = (int) (oldHeight + ((oldHeight * this.children.size()) / 1.4) + 5) / 2;
            }
            if (!minimized) {
                GL11.glPushMatrix();
                GL11.glScaled(0.5, 0.5, 0.5);
                for (Item e : children) {
                    e.x = ((this.x) + 3) * 2;
                    int offset = oldHeight;
                    offset /= 8;
                    offset += 4;
                    e.y = ((this.y) + (offset * (this.children.indexOf(e) + 1)) + 15) * 2;

                    e.update();

                }
                GL11.glScaled(1, 1, 1);
                GL11.glPopMatrix();
            }
        }
    };

    kFrame.setPinnable(false);
    addFrame(kFrame);
}