Example usage for org.lwjgl.opengl GL11 glRotatef

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

Introduction

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

Prototype

public static native void glRotatef(@NativeType("GLfloat") float angle, @NativeType("GLfloat") float x,
        @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);

Source Link

Document

Manipulates the current matrix with a rotation matrix.

Usage

From source file:com.rvantwisk.cnctools.opengl.View2D.java

License:Open Source License

@Override
public void ui_transform(float length) {
    GL11.glTranslatef(length, length, 0.0f);
    GL11.glRotatef(camera.getAzimuth(), 0.0f, 0.0f, 1.0f);
}

From source file:com.rvantwisk.cnctools.opengl.View2D.java

License:Open Source License

@Override
public void display_transform() {

    // _center_on_origin
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();//from   w w w .ja  va2  s.  c  om
    GL11.glOrtho(-camera.getX(), camera.getX(), -camera.getY(), camera.getY(), NEAR, FAR);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    // _center_on_origin

    GL11.glTranslatef(camera.getX(), camera.getY(), camera.getZ());
    GL11.glRotatef(camera.getAzimuth(), 0.0f, 0.0f, 1.0f);
    GL11.glScalef(camera.getZoom_factor(), camera.getZoom_factor(), camera.getZoom_factor());
}

From source file:com.rvantwisk.cnctools.opengl.View3D.java

License:Open Source License

@Override
public void ui_transform(float length) {
    GL11.glRotatef(-90f, 1.0f, 0.0f, 0.0f);
    GL11.glTranslatef(length, 0.0f, length);
    GL11.glRotatef(-camera.getElevation(), 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(camera.getAzimuth(), 0.0f, 0.0f, 1.0f);
}

From source file:com.rvantwisk.cnctools.opengl.View3D.java

License:Open Source License

@Override
public void display_transform() {
    GL11.glRotatef(-90f, 1.0f, 0.0f, 0.0f);
    GL11.glTranslatef(0.0f, camera.getY(), 0.0f);

    float f = camera.getZoom_factor();
    if (camera.isOrtho()) {
        f *= camera.getZOOM_ORTHO_ADJ();
    }//from   ww w. j  a  va2s .com
    GL11.glScalef(f, f, f);

    GL11.glTranslatef(camera.getX(), 0.0f, camera.getZ());
    GL11.glRotatef(-camera.getElevation(), 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(camera.getAzimuth(), 0.0f, 0.0f, 1.0f);

    GL11.glTranslatef(camera.getOffset_x(), camera.getOffset_y(), 0.0f);
}

From source file:com.savageboy74.savagetech.client.render.item.ItemRenderLootBox.java

License:Open Source License

private void renderLootBox(float x, float y, float z, int metaData) {
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.Model.LOOT_BOX);

    GL11.glPushMatrix(); //start
    GL11.glTranslatef(x, y, z); //size
    GL11.glRotatef(180, 1, 0, 0);
    GL11.glRotatef(-90, 0, 1, 0);/*from ww w  . j a  v  a  2s . co  m*/
    modelChest.renderAll();
    GL11.glPopMatrix(); //end
}

From source file:com.savageboy74.savagetech.client.render.tileentity.TileEntityRendererLootBox.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) {
    if (tileEntity instanceof TileEntityLootBox) {
        TileEntityLootBox tileEntityLootBox = (TileEntityLootBox) tileEntity;
        ForgeDirection direction = null;

        if (tileEntityLootBox.getWorldObj() != null) {
            direction = tileEntityLootBox.getOrientation();
        }//from  w w w. j a v a  2s  .c om

        this.bindTexture(Textures.Model.LOOT_BOX);
        GL11.glPushMatrix();
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F);
        GL11.glScalef(1.0F, -1.0F, -1.0F);
        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
        short angle = 0;

        if (direction != null) {
            if (direction == ForgeDirection.NORTH) {
                angle = 180;
            } else if (direction == ForgeDirection.SOUTH) {
                angle = 0;
            } else if (direction == ForgeDirection.WEST) {
                angle = 90;
            } else if (direction == ForgeDirection.EAST) {
                angle = -90;
            }
        }

        GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        float adjustedLidAngle = tileEntityLootBox.prevLidAngle
                + (tileEntityLootBox.lidAngle - tileEntityLootBox.prevLidAngle) * tick;
        adjustedLidAngle = 1.0F - adjustedLidAngle;
        adjustedLidAngle = 1.0F - adjustedLidAngle * adjustedLidAngle * adjustedLidAngle;
        modelChest.chestLid.rotateAngleX = -(adjustedLidAngle * (float) Math.PI / 2.0F);
        modelChest.renderAll();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    }
}

From source file:com.shinoow.abyssalcraft.client.handlers.AbyssalCraftClientEventHooks.java

License:Apache License

private void renderStarSpawnPlayer(EntityPlayer player, float partialTicks) {

    mc.renderEngine.bindTexture(new ResourceLocation("abyssalcraft:textures/model/tentacles.png"));

    for (int j = 0; j < 1; ++j) {
        GL11.glColor4f(1F, 1F, 1F, 1F);/*  w w w. j a  va 2  s .  c  o  m*/
        float f10 = player.prevRotationYawHead
                + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks
                - (player.prevRenderYawOffset
                        + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks);
        float f2 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks;
        GL11.glPushMatrix();
        GL11.glFrontFace(GL11.GL_CW);
        GL11.glRotatef(f10, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0, -0.22F, 0);
        GL11.glScalef(1, 1, 1);
        model.renderTentacles(0.0625F);
        GL11.glFrontFace(GL11.GL_CCW);
        GL11.glPopMatrix();
    }
}

From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDragonBoss.java

License:Apache License

@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    GL11.glPushMatrix();/*  w w  w. j  ava  2  s  . c o  m*/
    EntityDragonBoss entitydragon = (EntityDragonBoss) par1Entity;
    float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * partialTicks;
    jaw.rotateAngleX = (float) (Math.sin(f6 * (float) Math.PI * 2.0F) + 1.0D) * 0.2F;
    float f7 = (float) (Math.sin(f6 * (float) Math.PI * 2.0F - 1.0F) + 1.0D);
    f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F;
    GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F);
    GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F);
    float f8 = -30.0F;
    float f9 = 0.0F;
    float f10 = 1.5F;
    double[] adouble = entitydragon.getMovementOffsets(6, partialTicks);
    float f11 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0]
            - entitydragon.getMovementOffsets(10, partialTicks)[0]);
    float f12 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] + f11 / 2.0F);
    f8 += 2.0F;
    float f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 20.0F;
    float f14 = -12.0F;
    float f15;

    for (int i = 0; i < 5; ++i) {
        double[] adouble1 = entitydragon.getMovementOffsets(5 - i, partialTicks);
        f15 = (float) Math.cos(i * 0.45F + f13) * 0.15F;
        neck.rotateAngleY = updateRotations(adouble1[0] - adouble[0]) * (float) Math.PI / 180.0F * f10;
        neck.rotateAngleX = f15 + (float) (adouble1[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = -updateRotations(adouble1[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    head.rotationPointY = f8;
    head.rotationPointZ = f14;
    head.rotationPointX = f9;
    double[] adouble2 = entitydragon.getMovementOffsets(0, partialTicks);
    head.rotateAngleY = updateRotations(adouble2[0] - adouble[0]) * (float) Math.PI / 180.0F * 1.0F;
    head.rotateAngleZ = -updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * 1.0F;
    head.render(par7);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-f11 * f10 * 1.0F, 0.0F, 0.0F, 1.0F);
    GL11.glTranslatef(0.0F, -1.0F, 0.0F);
    body.rotateAngleZ = 0.0F;
    body.render(par7);

    for (int j = 0; j < 2; ++j) {
        GL11.glEnable(GL11.GL_CULL_FACE);
        f15 = f6 * (float) Math.PI * 2.0F;
        wing.rotateAngleX = 0.125F - (float) Math.cos(f15) * 0.2F;
        wing.rotateAngleY = 0.25F;
        wing.rotateAngleZ = (float) (Math.sin(f15) + 0.125D) * 0.8F;
        wingTip.rotateAngleZ = -((float) (Math.sin(f15 + 2.0F) + 0.5D)) * 0.75F;
        rearLeg.rotateAngleX = 1.0F + f7 * 0.1F;
        rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F;
        rearFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        frontLeg.rotateAngleX = 1.3F + f7 * 0.1F;
        frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F;
        frontFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        wing.render(par7);
        frontLeg.render(par7);
        rearLeg.render(par7);
        GL11.glScalef(-1.0F, 1.0F, 1.0F);

        if (j == 0)
            GL11.glCullFace(GL11.GL_FRONT);
    }

    GL11.glPopMatrix();
    GL11.glCullFace(GL11.GL_BACK);
    GL11.glDisable(GL11.GL_CULL_FACE);
    float f16 = -((float) Math.sin(f6 * (float) Math.PI * 2.0F)) * 0.0F;
    f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 10.0F;
    f14 = 60.0F;
    f9 = 0.0F;
    adouble = entitydragon.getMovementOffsets(11, partialTicks);

    for (int k = 0; k < 12; ++k) {
        adouble2 = entitydragon.getMovementOffsets(12 + k, partialTicks);
        f16 = (float) (f16 + Math.sin(k * 0.45F + f13) * 0.05000000074505806D);
        neck.rotateAngleY = (updateRotations(adouble2[0] - adouble[0]) * f10 + 180.0F) * (float) Math.PI
                / 180.0F;
        neck.rotateAngleX = f16 + (float) (adouble2[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    GL11.glPopMatrix();
}

From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDragonMinion.java

License:Apache License

@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    GL11.glPushMatrix();//  w  w w  .  ja va 2  s  .  com
    EntityDragonMinion entitydragon = (EntityDragonMinion) par1Entity;
    float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * partialTicks;
    jaw.rotateAngleX = (float) (Math.sin(f6 * (float) Math.PI * 2.0F) + 1.0D) * 0.2F;
    float f7 = (float) (Math.sin(f6 * (float) Math.PI * 2.0F - 1.0F) + 1.0D);
    f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F;
    GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F);
    GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F);
    float f8 = -30.0F;
    float f9 = 0.0F;
    float f10 = 1.5F;
    double[] adouble = entitydragon.getMovementOffsets(6, partialTicks);
    float f11 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0]
            - entitydragon.getMovementOffsets(10, partialTicks)[0]);
    float f12 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] + f11 / 2.0F);
    f8 += 2.0F;
    float f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 20.0F;
    float f14 = -12.0F;
    float f15;

    for (int i = 0; i < 5; ++i) {
        double[] adouble1 = entitydragon.getMovementOffsets(5 - i, partialTicks);
        f15 = (float) Math.cos(i * 0.45F + f13) * 0.15F;
        neck.rotateAngleY = updateRotations(adouble1[0] - adouble[0]) * (float) Math.PI / 180.0F * f10;
        neck.rotateAngleX = f15 + (float) (adouble1[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = -updateRotations(adouble1[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    head.rotationPointY = f8;
    head.rotationPointZ = f14;
    head.rotationPointX = f9;
    double[] adouble2 = entitydragon.getMovementOffsets(0, partialTicks);
    head.rotateAngleY = updateRotations(adouble2[0] - adouble[0]) * (float) Math.PI / 180.0F * 1.0F;
    head.rotateAngleZ = -updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * 1.0F;
    head.render(par7);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-f11 * f10 * 1.0F, 0.0F, 0.0F, 1.0F);
    GL11.glTranslatef(0.0F, -1.0F, 0.0F);
    body.rotateAngleZ = 0.0F;
    body.render(par7);

    for (int j = 0; j < 2; ++j) {
        GL11.glEnable(GL11.GL_CULL_FACE);
        f15 = f6 * (float) Math.PI * 2.0F;
        wing.rotateAngleX = 0.125F - (float) Math.cos(f15) * 0.2F;
        wing.rotateAngleY = 0.25F;
        wing.rotateAngleZ = (float) (Math.sin(f15) + 0.125D) * 0.8F;
        wingTip.rotateAngleZ = -((float) (Math.sin(f15 + 2.0F) + 0.5D)) * 0.75F;
        rearLeg.rotateAngleX = 1.0F + f7 * 0.1F;
        rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F;
        rearFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        frontLeg.rotateAngleX = 1.3F + f7 * 0.1F;
        frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F;
        frontFoot.rotateAngleX = 0.75F + f7 * 0.1F;
        wing.render(par7);
        frontLeg.render(par7);
        rearLeg.render(par7);
        GL11.glScalef(-1.0F, 1.0F, 1.0F);

        if (j == 0)
            GL11.glCullFace(GL11.GL_FRONT);
    }

    GL11.glPopMatrix();
    GL11.glCullFace(GL11.GL_BACK);
    GL11.glDisable(GL11.GL_CULL_FACE);
    float f16 = -((float) Math.sin(f6 * (float) Math.PI * 2.0F)) * 0.0F;
    f13 = f6 * (float) Math.PI * 2.0F;
    f8 = 10.0F;
    f14 = 60.0F;
    f9 = 0.0F;
    adouble = entitydragon.getMovementOffsets(11, partialTicks);

    for (int k = 0; k < 12; ++k) {
        adouble2 = entitydragon.getMovementOffsets(12 + k, partialTicks);
        f16 = (float) (f16 + Math.sin(k * 0.45F + f13) * 0.05000000074505806D);
        neck.rotateAngleY = (updateRotations(adouble2[0] - adouble[0]) * f10 + 180.0F) * (float) Math.PI
                / 180.0F;
        neck.rotateAngleX = f16 + (float) (adouble2[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F;
        neck.rotateAngleZ = updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * f10;
        neck.rotationPointY = f8;
        neck.rotationPointZ = f14;
        neck.rotationPointX = f9;
        f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D);
        f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D);
        neck.render(par7);
    }

    GL11.glPopMatrix();
}

From source file:com.shinoow.abyssalcraft.client.render.block.TileEntityAltarRenderer.java

License:Apache License

@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {

    GL11.glPushMatrix();/*from   www  .j a  va  2  s  .c  o  m*/
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    GL11.glPushMatrix();
    GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

    Minecraft.getMinecraft().renderEngine.bindTexture(Resourcelocation);
    model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    GL11.glPopMatrix();
    GL11.glPopMatrix();
}