Example usage for org.lwjgl.opengl GL11 glTranslated

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

Introduction

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

Prototype

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

Source Link

Document

Double version of #glTranslatef Translatef .

Usage

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);/* ww  w  . j  a  v  a 2s  .  com*/

    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.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 ww.j  a  v  a 2  s . c o m*/
    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.hea3ven.colladamodel.client.model.transform.Translation.java

License:Open Source License

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

From source file:com.kanbekotori.keycraft.renderer.RenderJavelin.java

License:Open Source License

public void doRender(EntityJavelin entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
    this.bindEntityTexture(entity);
    GL11.glPushMatrix();/*  ww  w . ja  v a  2  s . c  om*/
    GL11.glTranslated(x, y, z);
    //
    GL11.glTranslatef(0.0F, entity.height / 2.0F, 0.0F);
    GL11.glRotatef(entity.prevRotationYaw - 90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(entity.prevRotationPitch, 0.0F, 0.0F, 1.0F);

    Tessellator tessellator = Tessellator.instance;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);

    float f10 = 0.05625F;
    GL11.glScalef(f10, f10, f10);
    for (int i = 0; i < 4; ++i) {
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glNormal3f(0.0F, 0.0F, f10);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(-3.25D, -0.5D, 0.0D, 1.0D / 16.0D, 14.0D / 16.0D); // 
        tessellator.addVertexWithUV(3.25D, -0.5D, 0.0D, 14.0D / 16.0D, 1.0D / 16.0D); // 
        tessellator.addVertexWithUV(3.25D, 0.5D, 0.0D, 16.0D / 16.0D, 3.0D / 16.0D); // 
        tessellator.addVertexWithUV(-3.25D, 0.5D, 0.0D, 3.0D / 16.0D, 16.0D / 16.0D); // 
        tessellator.draw();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Triangle. Used for radars//w  w w  . j  ava 2  s .  co m
 * 
 * @param e
 * @param cx
 * @param cy
 * @param c
 */
public static void drawTriangle(Entity e, double cx, double cy, int c) {
    GL11.glPushMatrix();
    GL11.glScaled(0.5, 0.5, 0.5);
    GL11.glTranslated(cx, cy, 0);
    if (e instanceof EntityClientPlayerMP) {
        GL11.glRotatef(e.rotationYaw, 0F, 0F, 1.0F);
    } else {
        GL11.glRotatef(-e.rotationYaw, 0F, 0F, 1.0F);
    }
    float f = ((c >> 24) & 0xff) / 255F;
    float f1 = ((c >> 16) & 0xff) / 255F;
    float f2 = ((c >> 8) & 0xff) / 255F;
    float f3 = (c & 0xff) / 255F;
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glEnable(3042);
    GL11.glDisable(3553);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glBlendFunc(770, 771);
    GL11.glBegin(GL11.GL_TRIANGLES);

    GL11.glVertex2d(0, 0 + 6);
    GL11.glVertex2d(0 + 3, 0 - 2);
    GL11.glVertex2d(0 - 3, 0 - 2);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glEnable(3553);
    GL11.glDisable(3042);
    GL11.glRotatef(e.rotationYaw, 0F, 0F, 1.0F);

    GL11.glPopMatrix();
}

From source file:com.lukke100.sbdi.Sbdi.java

License:Open Source License

public static void main(String[] args) {
    System.out.println("Beginning Main Method");
    JyInjector jyInjector = new JyInjector();
    jyInjector.main();/* w  w  w .  j a v a  2  s  . c  o m*/
    try {
        Display.setDisplayMode(new DisplayMode(640, 480));
        Display.create();
        Display.setVSyncEnabled(true);
    } catch (LWJGLException e) {
        e.printStackTrace();
        System.exit(0);
    }
    GL11.glOrtho(0, 640, 0, 480, 0, 1);
    GL11.glTranslated(.5d, .5d, 0f);
    RenderBuffer.init();

    setActiveMap(new DebugMap(1024, 1024));
    final DebugEntity player = new DebugEntity(128, 128);
    DebugEntity temp = new DebugEntity(130, 128);
    activeCamera = new Camera(0, 0, 16, 12);
    activeCamera.center(player);
    player.queueRender(RenderLayer.ENTITY0);
    temp.queueRender(RenderLayer.ENTITY0);

    Input.addKeyTotal(Keyboard.KEY_RIGHT, Keyboard.KEY_LEFT, new Execute() {
        @Override
        public void exec() {
            player.goRight();

        }
    }, new Execute() {
        @Override
        public void exec() {
            player.idleX();

        }
    }, new Execute() {

        @Override
        public void exec() {
            player.goLeft();

        }
    });

    Input.addKeyTotal(Keyboard.KEY_UP, Keyboard.KEY_DOWN, new Execute() {

        @Override
        public void exec() {
            player.goUp();

        }
    }, new Execute() {

        @Override
        public void exec() {
            player.idleY();

        }
    }, new Execute() {

        @Override
        public void exec() {
            player.goDown();

        }
    });

    System.gc();
    while (!Display.isCloseRequested()) {
        GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
        Input.parseHotkeys();
        activeMap.markMoving(player);
        activeMap.markMoving(temp);
        activeMap.moveAll(true);
        activeCamera.center(player);
        Display.setTitle("COORDS: " + player.getxCoord() + " (" + player.getxTile() + "), " + player.getyCoord()
                + " (" + player.getyTile() + "), " + " - MEM: " + memUsage('m'));
        RenderBuffer.process();
        activeCamera.debugTiles();
        FPSCounter.update();
        Display.sync(240);
        Display.update();
    }
    Display.destroy();
    //jyInjector.exit();
}

From source file:com.minestellar.api.blocks.WireSpecialRender.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double translationX, double translationY,
        double translationZ, float f) {
    if (type == 0) {
        blockTexture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/blockCable"
                + tileEntity.blockMetadata + ".png");
    } else if (type == 1) {
        blockTexture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/blockPipe"
                + tileEntity.blockMetadata + ".png");
    } else if (type == 2) {
        blockTexture = new ResourceLocation(MinestellarCore.MOD_ID + "textures/model/tile/blockData.png");
    } else {//from   w w  w .j  av  a  2  s. c o m
        blockTexture = null;
    }

    GL11.glTranslated(translationX, translationY, translationZ);
    GL11.glDisable(GL11.GL_LIGHTING);

    if (blockTexture != null) {
        this.bindTexture(blockTexture);
    } else {
        throw new NullPointerException("Null Texture, check the ClientProxy");
    }

    TileEntityWire wire = (TileEntityWire) tileEntity;

    if (!wire.onlyOneOpposite(wire.connections)) {
        drawCore();

        for (int i = 0; i < wire.connections.length; i++) {
            if (wire.connections[i] != null) {
                drawConnector(wire.connections[i]);
            }
        }
    } else {
        for (int i = 0; i < wire.connections.length; i++) {
            if (wire.connections[i] != null) {
                drawStraight(wire.connections[i]);
                break;
            }
        }
    }

    GL11.glTranslated(-translationX, -translationY, -translationZ);
}

From source file:com.minestellar.api.core.WireSpecialRender.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double translationX, double translationY,
        double translationZ, float f) {
    if (type == 0) {
        blockTexture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/blockCable"
                + tileEntity.blockMetadata + ".png");
    } else if (type == 1) {
        blockTexture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/blockPipe"
                + tileEntity.blockMetadata + ".png");
    } else {/*from ww  w  .  j  a  v a 2  s  .c  o m*/
        blockTexture = null;
    }

    GL11.glTranslated(translationX, translationY, translationZ);
    GL11.glDisable(GL11.GL_LIGHTING);
    if (blockTexture != null) {
        this.bindTexture(blockTexture);
    } else {
        throw new NullPointerException("Null Texture, check the ClientProxy");
    }

    TileEntityWire wire = (TileEntityWire) tileEntity;

    if (!wire.onlyOneOpposite(wire.connections)) {
        drawCore();

        for (int i = 0; i < wire.connections.length; i++) {
            if (wire.connections[i] != null) {
                drawConnector(wire.connections[i]);
            }
        }
    } else {
        for (int i = 0; i < wire.connections.length; i++) {
            if (wire.connections[i] != null) {
                drawStraight(wire.connections[i]);
                break;
            }
        }
    }

    GL11.glTranslated(-translationX, -translationY, -translationZ);
}

From source file:com.minestellar.core.render.item.AntennaItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case ENTITY:/*from   w w w.  j  a va  2  s  . c o  m*/
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadioAntenna(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
        break;
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();
        GL11.glScaled(0.45D, 0.45D, 0.45D);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadioAntenna(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        GL11.glScaled(0.45D, 0.45D, 0.45D);
        GL11.glRotated(-180, 0, 10, 0);
        GL11.glTranslated(0, -0.65, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadioAntenna(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0, +0.65, 0);
        GL11.glPopMatrix();
        break;
    }
}

From source file:com.minestellar.core.render.item.CableItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();/* w  ww . ja  v a 2 s  .  co  m*/
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCable(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 2);
        GL11.glTranslated(0, -0.1255, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCable(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0, 0.1255, 0);
        GL11.glPopMatrix();
        break;
    case ENTITY:
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 2);
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCable(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
        break;
    default:
        break;
    }
}