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.builtbroken.atomic.content.machines.processing.centrifuge.render.TESRChemCentrifuge.java

@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float deltaFrame) {
    GL11.glPushMatrix();/*from www .jav a  2  s  .co  m*/
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    GL11.glScaled(0.0625f, 0.0625f, 0.0625f);

    if (tile instanceof TileEntityChemCentrifuge) {
        TileEntityChemCentrifuge entityChemExtractor = (TileEntityChemCentrifuge) tile;
        ForgeDirection facing = entityChemExtractor.getFacingDirection();

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

        bindTexture(texture);

        //Render main body
        model_body.renderAll();

        //Render rotating parts
        GL11.glRotatef(((TileEntityChemCentrifuge) tile).rotate(deltaFrame), 0, 1, 0);
        model_core.renderAll();
    }

    GL11.glPopMatrix();
}

From source file:com.builtbroken.atomic.content.machines.processing.extractor.render.RenderItemExtractor.java

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    GL11.glPushMatrix();/*  ww  w . j av a2 s  .  co  m*/
    GL11.glScaled(0.0625f, 0.0625f, 0.0625f);
    if (type.equals(ItemRenderType.INVENTORY)) {
        GL11.glTranslatef(-0.5f, -0.8f, -0.5f);
        GL11.glRotatef(180f, 0, 1, 0);
    } else if (type.equals(ItemRenderType.EQUIPPED_FIRST_PERSON)) {
        GL11.glRotatef(45f, 0, 1, 0);
        GL11.glTranslatef(1f, 12f, 9f);
    } else if (type.equals(ItemRenderType.EQUIPPED)) {
        GL11.glTranslatef(8f, 10f, 8f);
    }
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture);
    model_base.renderAll();
    model_drum.renderAll();
    GL11.glPopMatrix();
}

From source file:com.builtbroken.atomic.content.machines.processing.extractor.render.TESRChemExtractor.java

@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float deltaFrame) {
    GL11.glPushMatrix();//from www  .java 2s .co m
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    GL11.glScaled(0.0625f, 0.0625f, 0.0625f);

    if (tile instanceof TileEntityChemExtractor) {
        TileEntityChemExtractor entityChemExtractor = (TileEntityChemExtractor) tile;
        ForgeDirection facing = entityChemExtractor.getFacingDirection();

        switch (facing) {
        case NORTH:
            GL11.glRotatef(-90, 0, 1, 0);
            break;
        case SOUTH:
            GL11.glRotatef(90, 0, 1, 0);
            break;
        case EAST:
            GL11.glRotatef(180, 0, 1, 0);
            break;
        case WEST:
            //Good by default
            break;
        }

        bindTexture(texture);

        //Render main body
        model_base.renderAll();

        //Render rotating parts
        GL11.glTranslated(-2.5, 1.5, 0);
        float rotation = ((TileEntityChemExtractor) tile).rotate(deltaFrame);
        GL11.glRotatef(rotation, 0, 0, 1);
        model_drum.renderAll();
    }

    GL11.glPopMatrix();
}

From source file:com.builtbroken.atomic.content.machines.reactor.fission.core.RenderItemReactor.java

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    GL11.glPushMatrix();/*from   w  w  w  .j  a  va2s.com*/
    GL11.glScaled(0.0625f, 0.0625f, 0.0625f);
    if (type.equals(ItemRenderType.INVENTORY)) {
        GL11.glTranslatef(-0.5f, -0.8f, -0.5f);
        GL11.glRotatef(180f, 0, 1, 0);
    } else if (type.equals(ItemRenderType.EQUIPPED_FIRST_PERSON)) {
        GL11.glRotatef(45f, 0, 1, 0);
        GL11.glTranslatef(1f, 12f, 9f);
    } else if (type.equals(ItemRenderType.EQUIPPED)) {
        GL11.glTranslatef(8f, 10f, 8f);
    }
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture);
    model.renderAll();
    GL11.glPopMatrix();
}

From source file:com.builtbroken.atomic.content.machines.reactor.fission.core.TESRReactorCell.java

@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float deltaFrame) {
    GL11.glPushMatrix();//from  w  w  w.jav a  2 s  .c om
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    GL11.glScaled(0.0625f, 0.0625f, 0.0625f);

    if (tile instanceof TileEntityReactorCell) {
        TileEntityReactorCell reactorCell = (TileEntityReactorCell) tile;
        if (reactorCell.isBottom()) {
            bindTexture(bottom_texture);
            bottom_model.renderAll();
        } else if (reactorCell.isTop()) {
            bindTexture(top_texture);
            top_model.renderAll();
        } else if (reactorCell.isMiddle()) {
            bindTexture(middle_texture);
            middle_model.renderAll();
        } else {
            bindTexture(normal_texture);
            normal_model.renderAll();
        }

        if (reactorCell.shouldRenderFuel()) {
            //TODO render fuel rods
            //TODO decrease in size as fuel is used
            //TODO decrease in color (green -> grey) as its used
            //TODO glow when running (blue or green? hmm)
            //TODO glow molten like if overheating
        }
    }

    GL11.glPopMatrix();
}

From source file:com.builtbroken.icbm.content.crafting.station.small.auto.TileSMAutoCraftClient.java

@Override
public void renderInventoryItem(IItemRenderer.ItemRenderType type, ItemStack itemStack, Object... data) {
    GL11.glTranslatef(0f, 0f, 0f);//from  ww  w  . j  a va 2s  .  c om
    GL11.glRotatef(-20f, 0, 1, 0);
    GL11.glScaled(.7f, .7f, .7f);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.SMALL_WORKSTATION_TEXTURE2);
    Assets.CART1x3.renderAll();
}

From source file:com.builtbroken.icbm.content.crafting.station.small.TileSmallMissileWorkstationClient.java

@Override
public void renderInventoryItem(IItemRenderer.ItemRenderType type, ItemStack itemStack, Object... data) {
    GL11.glTranslatef(-1f, 0f, 0.1f);/*from   w  ww .  j  a va 2  s .  c  om*/
    GL11.glRotatef(-20f, 0, 1, 0);
    GL11.glScaled(.7f, .7f, .7f);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.SMALL_WORKSTATION_TEXTURE2);
    Assets.SMALL_MISSILE_STATION_MODEL2.renderAll();
    //TODO add work table
}

From source file:com.builtbroken.icbm.content.crafting.station.small.TileSmallMissileWorkstationClient.java

/**
 * Handles rendering of the missile// w  w  w  .j  av a2s.  c o  m
 *
 * @param pos - offset for render
 */
public static void renderMissile(Pos pos, IMissile misssile, ForgeDirection connectedBlockSide,
        ForgeDirection direction) {
    ///Center render view to tile center
    GL11.glTranslatef(pos.xf() + 0.5f, pos.yf() + 0.5f, pos.zf() + 0.5f);
    //Slight scale of the lenght to fit on the table
    GL11.glScaled(1, .9, 1);

    //Handles setting the rotation based on the side
    switch (connectedBlockSide) {
    case UP:
    case DOWN:
        handleMissileRotationUD(direction);
        break;
    case EAST:
    case WEST:
        handleMissileRotationEW(direction);
        break;
    case SOUTH:
    case NORTH:
        handleMissileRotationNS(direction);
        break;
    }
    //Moves the missile slightly over to sit on its rack
    GL11.glTranslatef(0, -0.4f, 0);
    //Bind texture
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.SMALL_MISSILE_TEXTURE);
    //Group_001 body
    //Component_1_001 - 4 Body Fins
    if (misssile.getWarhead() != null) {
        //Group_004 nose of warhead
        //Group_005 warhead
        Assets.SMALL_MISSILE_MODEL.renderOnly("Group_005");
        if (misssile.getWarhead().getExplosive() != null) {
            Assets.SMALL_MISSILE_MODEL.renderOnly("Group_004");
        }
    }
    if (misssile.getEngine() != null) {
        //Group_002 - Engine thruster
        //Group_003 - Engine case
        //Component_3_001 - 8 Engine lower segments
        //Component_2_001 - 4 Engine fins
        Assets.SMALL_MISSILE_MODEL.renderOnly("Group_002", "Group_003");
        for (int i = 1; i < 9; i++) {
            Assets.SMALL_MISSILE_MODEL.renderOnly("Component_3_00" + i);
        }
        for (int i = 1; i < 5; i++) {
            Assets.SMALL_MISSILE_MODEL.renderOnly("Component_2_00" + i);
        }
    }
    if (misssile.getGuidance() != null) {
        //TODO add model indication showing no guidance added
    }
    //Render body and fins
    Assets.SMALL_MISSILE_MODEL.renderOnly("Group_001", "Component_1_001", "Component_1_002", "Component_1_003",
            "Component_1_004");
}

From source file:com.builtbroken.icbm.content.fof.TileFoFClient.java

@Override
public void renderInventoryItem(IItemRenderer.ItemRenderType type, ItemStack itemStack, Object... data) {
    if (type == IItemRenderer.ItemRenderType.INVENTORY) {
        GL11.glTranslatef(-0.5f, -0.6f, -0.5f);
        GL11.glScaled(.5f, .5f, .5f);
    } else if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
        GL11.glRotatef(150f, 0, 1, 0);//from   ww w. j a  v a 2 s.c om
    } else if (type == IItemRenderer.ItemRenderType.EQUIPPED) {
        GL11.glRotatef(150f, 0, 1, 0);
        GL11.glTranslatef(-0.5f, 0.3f, -0.5f);
    }
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.FoF_STATION_TEXTURE);
    Assets.FoF_STATION_MODEL.renderAll();
}

From source file:com.builtbroken.icbm.content.launcher.silo.TileStandardSilo.java

@Override
public void renderInventoryItem(IItemRenderer.ItemRenderType type, ItemStack itemStack, Object... data) {
    GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
    GL11.glScaled(.8f, .8f, .8f);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.SMALL_SILO_TEXTURE);
    GL11.glColor3f(1.0f, 0f, 0f);//from   w ww .jav  a 2s  .co m
    Assets.SMALL_SILO_MODEL.renderOnly("Group_001", "Component_1_001");
}