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:cn.lambdalib.util.deprecated.ViewOptimize.java

License:MIT License

public static void fixFirstPerson() {
    GL11.glTranslated(fpOffsetX, fpOffsetY, fpOffsetZ);
}

From source file:cn.lambdalib.util.deprecated.ViewOptimize.java

License:MIT License

public static void fixThirdPerson() {
    GL11.glTranslated(tpOffsetX, tpOffsetY, tpOffsetZ);
}

From source file:cn.lambdalib.vis.model.renderer.ItemModelRenderer.java

License:MIT License

private void doFixedTransform() {
    GL11.glRotated(35, 0, 0, 1);
    GL11.glTranslated(0.8, -.12, 0);
}

From source file:cn.liutils.api.client.render.RendererSidedCube.java

License:Open Source License

public void doRender(TileEntity tileEntity, double x, double y, double z, float f) {
    Tessellator t = Tessellator.instance;
    int var5 = tileEntity.getBlockMetadata();
    block.setBlockBoundsBasedOnState(tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord,
            tileEntity.zCoord);/*from  www  . ja  v a2  s  . c o  m*/
    setBound(block);

    Vec3 v1, v2, v3, v4, v5, v6, v7, v8;
    v1 = RenderUtils.newV3(minX, minY, minZ);
    v2 = RenderUtils.newV3(minX, minY, maxZ);
    v3 = RenderUtils.newV3(minX, maxY, maxZ);
    v4 = RenderUtils.newV3(minX, maxY, minZ);

    v5 = RenderUtils.newV3(maxX, minY, minZ);
    v6 = RenderUtils.newV3(maxX, minY, maxZ);
    v7 = RenderUtils.newV3(maxX, maxY, maxZ);
    v8 = RenderUtils.newV3(maxX, maxY, minZ);

    GL11.glPushMatrix();
    GL11.glTranslated(x, y, z);

    RenderUtils.loadTexture(getTexture(tileEntity, 4, var5));
    t.startDrawingQuads();
    t.setNormal(-1, 0, 0);
    addVertex(v1, 0, 1);
    addVertex(v2, 1, 1);
    addVertex(v3, 1, 0);
    addVertex(v4, 0, 0);
    t.draw();

    RenderUtils.loadTexture(getTexture(tileEntity, 5, var5));
    t.startDrawingQuads();
    t.setNormal(1, 0, 0);
    addVertex(v8, 1, 0);
    addVertex(v7, 0, 0);
    addVertex(v6, 0, 1);
    addVertex(v5, 1, 1);
    t.draw();

    RenderUtils.loadTexture(getTexture(tileEntity, 2, var5));
    t.startDrawingQuads();
    t.setNormal(0, 0, -1);
    addVertex(v4, 1, 0);
    addVertex(v8, 0, 0);
    addVertex(v5, 0, 1);
    addVertex(v1, 1, 1);
    t.draw();

    RenderUtils.loadTexture(getTexture(tileEntity, 3, var5));
    t.startDrawingQuads();
    t.setNormal(0, 0, 1);
    addVertex(v3, 0, 0);
    addVertex(v2, 0, 1);
    addVertex(v6, 1, 1);
    addVertex(v7, 1, 0);
    t.draw();

    RenderUtils.loadTexture(getTexture(tileEntity, 1, var5));
    t.startDrawingQuads();
    t.setNormal(0, 1, 0);
    addVertex(v3, 0, 0);
    addVertex(v7, 1, 0);
    addVertex(v8, 1, 1);
    addVertex(v4, 0, 1);
    t.draw();

    RenderUtils.loadTexture(getTexture(tileEntity, 0, var5));
    t.startDrawingQuads();
    t.setNormal(0, -1, 0);
    addVertex(v1, 0, 1);
    addVertex(v5, 1, 1);
    addVertex(v6, 1, 0);
    addVertex(v2, 0, 0);
    t.draw();

    GL11.glPopMatrix();
}

From source file:cn.liutils.api.client.render.RenderIcon.java

License:Open Source License

@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    GL11.glEnable(GL11.GL_BLEND);//from   ww  w . j a  va  2  s. c  om
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_CULL_FACE);
    if (!enableDepth)
        GL11.glDisable(GL11.GL_DEPTH_TEST);
    if (!hasLight)
        GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPushMatrix();
    {
        GL11.glTranslatef((float) par2, (float) par4, (float) par6);
        GL11.glScalef(size, size, size);

        if (this.viewOptimize) {
            boolean firstPerson = Minecraft.getMinecraft().gameSettings.thirdPersonView == 0;
            if (firstPerson) {
                GL11.glTranslated(fpOffsetX, fpOffsetY, fpOffsetZ);
            } else {
                GL11.glTranslated(tpOffsetX, tpOffsetY, tpOffsetZ);
            }
        }

        if (icon != null)
            RenderUtils.loadTexture(icon);

        Tessellator t = Tessellator.instance;
        this.func_77026_a(t);

    }
    GL11.glPopMatrix();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.liutils.api.draw.prop.Offset.java

License:Open Source License

@Override
public void onEvent(EventType event, DrawObject obj) {
    GL11.glTranslated(tx, ty, tz);
}

From source file:cn.liutils.api.draw.prop.Transform.java

License:Open Source License

@Override
public void onEvent(EventType event, DrawObject obj) {
    switch (event) {
    case PRE_TRANSFORM:
        GL11.glTranslated(tx, ty, tz);
        break;/*from   ww w.  j  av a 2  s. c  o m*/
    case POST_TRANSFORM:
        GL11.glTranslated(pivotX, pivotY, pivotZ);
        GL11.glRotated(yaw, 0, 1, 0);
        GL11.glRotated(pitch, 1, 0, 0);
        GL11.glRotated(roll, 0, 0, 1);
        GL11.glTranslated(-pivotX, -pivotY, -pivotZ);
        break;
    default: //wtf?
        break;
    }
}

From source file:cn.liutils.api.draw.prop.Transform.java

License:Open Source License

public void perform() {
    GL11.glTranslated(tx, ty, tz);
    GL11.glTranslated(pivotX, pivotY, pivotZ);
    GL11.glRotated(yaw, 0, 1, 0);//  ww w .  j  av a 2  s . c  om
    GL11.glRotated(pitch, 1, 0, 0);
    GL11.glRotated(roll, 0, 0, 1);
    GL11.glTranslated(-pivotX, -pivotY, -pivotZ);
}

From source file:cn.liutils.api.draw.tess.CrossedSquare.java

License:Open Source License

@Override
public void onEvent(EventType event, DrawObject obj) {
    Tessellator t = Tessellator.instance;
    GL11.glTranslated(tx, ty, tz); //built in offset, usually in order to move it to center
    t.startDrawingQuads();//from  ww w .  jav a2 s . com
    {
        obj.post(EventType.IN_TESS);
        t.addVertexWithUV(0, 0, 0, map.u0, map.getMaxV());
        t.addVertexWithUV(0, 0, width, map.getMaxU(), map.getMaxV());
        t.addVertexWithUV(0, height, width, map.getMaxU(), map.v0);
        t.addVertexWithUV(0, height, 0, map.u0, map.v0);

        double hh = height / 2;
        t.addVertexWithUV(-hh, hh, 0, map.u0, map.getMaxV());
        t.addVertexWithUV(-hh, hh, width, map.getMaxU(), map.getMaxV());
        t.addVertexWithUV(hh, hh, width, map.getMaxU(), map.v0);
        t.addVertexWithUV(hh, hh, 0, map.u0, map.v0);
    }
    t.draw();
}

From source file:cn.liutils.api.draw.tess.Rect.java

License:Open Source License

@Override
public void onEvent(EventType event, DrawObject obj) {
    Tessellator t = Tessellator.instance;
    GL11.glTranslated(tx, ty, tz); //built in offset, usually in order to move it to center
    t.startDrawingQuads();//w w  w.  j  a  va2  s  . c  o m
    {
        obj.post(EventType.IN_TESS);
        t.setNormal(1, 0, 0);
        t.addVertexWithUV(0, 0, 0, map.getMinU(), map.getMaxV());
        t.addVertexWithUV(0, 0, width, map.getMaxU(), map.getMaxV());
        t.addVertexWithUV(0, height, width, map.getMaxU(), map.getMinV());
        t.addVertexWithUV(0, height, 0, map.getMinU(), map.getMinV());
    }
    t.draw();
}