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:gravestone.models.block.ModelSpawnerPentagram.java

License:LGPL

public void renderAll() {
    pentagram.render(0.0625F);// ww  w. j a  v a2  s .c o  m

    TileEntityGSSpawnerRenderer.instance.bindTextureByName(candleTexture);
    GL11.glPushMatrix();
    GL11.glTranslated(0, 0, 1);
    GL11.glRotated(180, 0, 1, 0);
    candle1.renderAll();
    GL11.glPopMatrix();

    TileEntityGSSpawnerRenderer.instance.bindTextureByName(candleTexture);
    GL11.glPushMatrix();
    GL11.glTranslated(0.95, 0, 0.3);
    GL11.glRotated(252, 0, 1, 0);
    candle2.renderAll();
    GL11.glPopMatrix();

    TileEntityGSSpawnerRenderer.instance.bindTextureByName(candleTexture);
    GL11.glPushMatrix();
    GL11.glTranslated(-0.95, 0, 0.3);
    GL11.glRotated(108, 0, 1, 0);
    candle3.renderAll();
    GL11.glPopMatrix();

    TileEntityGSSpawnerRenderer.instance.bindTextureByName(candleTexture);
    GL11.glPushMatrix();
    GL11.glTranslated(-0.59, 0, -0.8);
    GL11.glRotated(36, 0, 1, 0);
    candle4.renderAll();
    GL11.glPopMatrix();

    TileEntityGSSpawnerRenderer.instance.bindTextureByName(candleTexture);
    GL11.glPushMatrix();
    GL11.glTranslated(0.61, 0, -0.8);
    GL11.glRotated(-36, 0, 1, 0);
    candle5.renderAll();
    GL11.glPopMatrix();
}

From source file:gravestone.models.entity.ModelSkullCrawler.java

License:LGPL

@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    GL11.glPushMatrix();/*  ww w.j  av  a  2 s .  c  o  m*/
    GL11.glTranslated(0, -0.05, 0);
    skull.render(entity, f, f1, f2, f3, f4, f5);
    GL11.glPopMatrix();

    rightLeg1.render(f5);
    rightLeg2.render(f5);
    rightLeg3.render(f5);
    rightLeg4.render(f5);
    leftLeg1.render(f5);
    leftLeg2.render(f5);
    leftLeg3.render(f5);
    leftLeg4.render(f5);
}

From source file:gravestone.renderer.tileentity.TileEntityGSSpawnerRenderer.java

License:LGPL

/**
 * Render a skull tile entity./*from   ww  w. j av  a  2s  .c om*/
 */
public void renderSpawnerPentagramAt(TileEntityGSSpawner tileEntity, float x, float y, float z, float par8) {

    this.bindTexture(Resources.PENTAGRAM);

    GL11.glPushMatrix();
    if (tileEntity.getWorld() != null) {
        GL11.glTranslatef(x + 0.5F, y + 1.5F, z + 0.5F);
        GL11.glScalef(1, -1, -1);
    } else {
        GL11.glTranslatef(x + 0.5F, y + 1, z + 0.5F);
        GL11.glScalef(0.6F, -0.6F, -0.6F);
    }
    GL11.glTranslated(0, -0.01, 0);

    EnumSpawner spawnerType = EnumSpawner.getById((byte) tileEntity.getBlockMetadata());
    ModelSpawnerPentagram spawner = getSpawnerModel(spawnerType);
    spawner.renderAll();
    GL11.glPopMatrix();
}

From source file:hellfirepvp.astralsorcery.client.effect.block.EffectTranslucentFallingBlock.java

License:Open Source License

@Override
public void render(float pTicks) {
    TextureHelper.refreshTextureBindState();
    TextureHelper.setActiveTextureToAtlasSprite();
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glPushMatrix();//from   w ww. j a v a  2 s.c  o  m
    GL11.glColor4f(1F, 1F, 1F, 1F);
    GL11.glEnable(GL11.GL_BLEND);
    Blending.ADDITIVEDARK.apply();
    if (disableDepth) {
        GL11.glDisable(GL11.GL_DEPTH_TEST);
    }
    GL11.glDisable(GL11.GL_CULL_FACE);

    RenderingUtils.removeStandartTranslationFromTESRMatrix(pTicks);

    Vector3 translateTo = getInterpolatedPosition(pTicks);
    GL11.glTranslated(translateTo.getX(), translateTo.getY(), translateTo.getZ());

    float alpha = alphaFunction.getAlpha(age, maxAge);
    alpha *= alphaMultiplier;
    GL11.glColor4f(1F, 1F, 1F, alpha);

    float scaleF = this.scale;
    scaleF = scaleFunction.getScale(this, pTicks, scaleF);
    GL11.glTranslated(0.5, 0.5, 0.5);
    GL11.glScaled(scaleF, scaleF, scaleF);
    GL11.glTranslated(-0.5, -0.5, -0.5);

    Vector3 rotation = getInterpolatedRotation(pTicks);
    GL11.glTranslated(0.5, 0.5, 0.5);
    GL11.glRotated(rotation.getX(), 1, 0, 0);
    GL11.glRotated(rotation.getY(), 0, 1, 0);
    GL11.glRotated(rotation.getZ(), 0, 0, 1);
    GL11.glTranslated(-0.5, -0.5, -0.5);

    Tessellator tes = Tessellator.getInstance();
    VertexBuffer vb = tes.getBuffer();
    vb.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    IBlockAccess world = new AirBlockRenderWorld(Biomes.PLAINS, Minecraft.getMinecraft().world.getWorldType());
    Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlock(this.blockState, BlockPos.ORIGIN, world,
            vb);
    tes.draw();

    GL11.glEnable(GL11.GL_CULL_FACE);
    if (disableDepth) {
        GL11.glEnable(GL11.GL_DEPTH_TEST);
    }
    Blending.DEFAULT.apply();
    GL11.glColor4f(1F, 1F, 1F, 1F);
    GL11.glPopMatrix();
    GL11.glPopAttrib();
    TextureHelper.refreshTextureBindState();
}

From source file:hellfirepvp.astralsorcery.client.effect.compound.CompoundEffectSphere.java

License:Open Source License

@Override
public void render(VertexBuffer vb, float pTicks) {
    RenderingUtils.removeStandartTranslationFromTESRMatrix(pTicks);
    GL11.glTranslated(offset.getX(), offset.getY(), offset.getZ());
    float alpha = 1F;
    if (alphaFadeMaxDist != -1 && Minecraft.getMinecraft().player != null) {
        Vector3 plVec = new Vector3(Minecraft.getMinecraft().player);
        double dst = plVec.distance(getPosition()) - 1.2;

        alpha *= 1D - (dst / alphaFadeMaxDist);
        if (removeIfInvisible && alpha <= 0) {
            requestRemoval();//  ww w . j a  va  2s  .c  om
        }
        alpha = MathHelper.clamp(alpha, 0, 1);
    }
    for (SolidColorTriangleFace face : this.sphereFaces) {
        vb.pos(face.v1.getX(), face.v1.getY(), face.v1.getZ()).color(0, 0, 0, alpha).endVertex();
        vb.pos(face.v2.getX(), face.v2.getY(), face.v2.getZ()).color(0, 0, 0, alpha).endVertex();
        vb.pos(face.v3.getX(), face.v3.getY(), face.v3.getZ()).color(0, 0, 0, alpha).endVertex();
    }
}

From source file:hellfirepvp.astralsorcery.client.effect.light.EffectLightbeam.java

License:Open Source License

private void removeOldTranslate(Entity entity, float partialTicks) {
    double x = entity.lastTickPosX + ((entity.posX - entity.lastTickPosX) * partialTicks);
    double y = entity.lastTickPosY + ((entity.posY - entity.lastTickPosY) * partialTicks);
    double z = entity.lastTickPosZ + ((entity.posZ - entity.lastTickPosZ) * partialTicks);
    GL11.glTranslated(-x, -y, -z);
}

From source file:hellfirepvp.astralsorcery.client.event.ClientRenderEventHandler.java

License:Open Source License

@SideOnly(Side.CLIENT)
private void renderAlignmentChargeOverlay(float partialTicks) {
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glPushMatrix();/*from   w  w  w.java  2  s  . c  om*/
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    Blending.DEFAULT.apply();

    float height = 128F;
    float width = 32F;
    float offsetX = 0F;
    float offsetY = 5F;

    texChargeFrame.bind();
    GL11.glColor4f(1F, 1F, 1F, visibilityPermCharge * 0.9F);

    //Draw hud itself
    Tessellator tes = Tessellator.getInstance();
    VertexBuffer vb = tes.getBuffer();
    vb.begin(7, DefaultVertexFormats.POSITION_TEX);
    vb.pos(offsetX, offsetY + height, 10).tex(0, 1).endVertex();
    vb.pos(offsetX + width, offsetY + height, 10).tex(1, 1).endVertex();
    vb.pos(offsetX + width, offsetY, 10).tex(1, 0).endVertex();
    vb.pos(offsetX, offsetY, 10).tex(0, 0).endVertex();
    tes.draw();

    //Draw charge
    float filled = ConstellationPerkLevelManager.getPercToNextLevel(ResearchManager.clientProgress);
    height = 78F;
    offsetY = 27.5F + (1F - filled) * height;
    GL11.glColor4f(255F / 255F, 230F / 255F, 0F / 255F, visibilityPermCharge * 0.9F);
    texChargeCharge.bind();
    height *= filled;

    vb.begin(7, DefaultVertexFormats.POSITION_TEX);
    vb.pos(offsetX, offsetY + height, 10).tex(0, 1).endVertex();
    vb.pos(offsetX + width, offsetY + height, 10).tex(1, 1).endVertex();
    vb.pos(offsetX + width, offsetY, 10).tex(1, 1F - filled).endVertex();
    vb.pos(offsetX, offsetY, 10).tex(0, 1F - filled).endVertex();
    tes.draw();

    GL11.glEnable(GL11.GL_ALPHA_TEST);
    TextureHelper.refreshTextureBindState();
    //Draw level
    int level = ResearchManager.clientProgress.getAlignmentLevel();
    GL11.glColor4f(0.86F, 0.86F, 0.86F, visibilityPermCharge);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glPushMatrix();
    GL11.glTranslated(offsetX + 13, 94, 0);
    GL11.glScaled(1.2, 1.2, 1.2);
    int c = 0x00DDDDDD;
    c |= ((int) (255F * visibilityPermCharge)) << 24;
    if (visibilityPermCharge > 0.1E-4) {
        Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(String.valueOf(level + 1), 0, 0, c);
    }
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    TextureHelper.refreshTextureBindState();
    Blending.DEFAULT.apply();
    GL11.glColor4f(1F, 1F, 1F, 1F);
    GlStateManager.color(1F, 1F, 1F, 1F);
    GL11.glPopMatrix();
    GL11.glPopAttrib();
}

From source file:hellfirepvp.astralsorcery.client.gui.container.GuiAltarAttunement.java

License:Open Source License

@Override
public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    AbstractAltarRecipe rec = findCraftableRecipe();
    if (rec != null) {
        ItemStack out = rec.getOutputForRender();
        zLevel = 10F;//from  w  w w.j  av  a  2 s . c om
        itemRender.zLevel = 10F;

        RenderHelper.enableGUIStandardItemLighting();

        GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
        GL11.glPushMatrix();
        GL11.glTranslated(190, 35, 0);
        GL11.glScaled(2.5, 2.5, 2.5);

        itemRender.renderItemAndEffectIntoGUI(mc.player, out, 0, 0);
        itemRender.renderItemOverlayIntoGUI(fontRenderer, out, 0, 0, null);

        GL11.glPopMatrix();
        GL11.glPopAttrib();

        //RenderHelper.disableStandardItemLighting();

        zLevel = 0F;
        itemRender.zLevel = 0F;

        TextureHelper.refreshTextureBindState();
    }
}

From source file:hellfirepvp.astralsorcery.client.gui.container.GuiAltarConstellation.java

License:Open Source License

@Override
public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    AbstractAltarRecipe rec = findCraftableRecipe();
    if (rec != null) {
        ItemStack out = rec.getOutputForRender();
        zLevel = 10F;/*  w  ww . ja va2s. c o m*/
        itemRender.zLevel = 10F;

        RenderHelper.enableGUIStandardItemLighting();

        GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
        GL11.glPushMatrix();
        GL11.glTranslated(190, 35, 0);
        GL11.glScaled(2.5, 2.5, 2.5);

        itemRender.renderItemAndEffectIntoGUI(mc.player, out, 0, 0);
        itemRender.renderItemOverlayIntoGUI(fontRenderer, out, 0, 0, null);

        GL11.glPopMatrix();
        GL11.glPopAttrib();

        zLevel = 0F;
        itemRender.zLevel = 0F;

        TextureHelper.refreshTextureBindState();
    }
}

From source file:hellfirepvp.astralsorcery.client.gui.container.GuiAltarDiscovery.java

License:Open Source License

@Override
public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    AbstractAltarRecipe rec = findCraftableRecipe();
    if (rec != null) {
        ItemStack out = rec.getOutputForRender();
        zLevel = 10F;/*from w  w w  .j  av  a  2  s .  c  om*/
        itemRender.zLevel = 10F;

        RenderHelper.enableGUIStandardItemLighting();

        GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
        GL11.glPushMatrix();
        GL11.glTranslated(130, 20, 0);
        GL11.glScaled(1.7, 1.7, 1.7);

        itemRender.renderItemAndEffectIntoGUI(mc.player, out, 0, 0);
        itemRender.renderItemOverlayIntoGUI(fontRenderer, out, 0, 0, null);

        GL11.glPopMatrix();
        GL11.glPopAttrib();

        RenderHelper.disableStandardItemLighting();

        zLevel = 0F;
        itemRender.zLevel = 0F;

        TextureHelper.refreshTextureBindState();
    }
}