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.minestellar.core.render.tile.TileEntityRenderComputer.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ,
        float f) {
    this.bindTexture(new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/computer.png"));
    GL11.glPushMatrix();//from   w  w  w  . j  a  va2  s .c o m
    GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
    model.renderModel(0.0625F);
    GL11.glPopMatrix();
}

From source file:com.minestellar.core.render.tile.TileEntityRenderGasSink.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ,
        float f) {
    texture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/gasSink.png");
    this.bindTexture(texture);
    GL11.glPushMatrix();//from   w ww  .  j  av  a  2  s . c  o  m
    GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
    model.renderModel(0.0625F);
    // model.render(null, 0.04F, 1.0F, 1.0F, 1.0F, 1.0F, 0.0625F);
    GL11.glPopMatrix();
}

From source file:com.minestellar.core.render.tile.TileEntityRenderOxygenCollector.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ,
        float f) {
    texture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/oxygenCollector.png");
    this.bindTexture(texture);
    GL11.glPushMatrix();//from   w  ww  .ja  va 2 s.c  o  m
    GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
    model.renderModel(0.0625F);
    GL11.glPopMatrix();
}

From source file:com.minestellar.core.render.tile.TileEntityRenderSolarPanel.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tile, double translationX, double translationY, double translationZ,
        float f) {
    texture = new ResourceLocation(MinestellarCore.TEXTURE_PREFIX + "textures/model/tile/solarPanel.png");
    this.bindTexture(texture);
    GL11.glPushMatrix();/* w  w  w.jav a 2  s . co m*/
    GL11.glTranslatef((float) translationX + 0.5F, (float) translationY + 1.5F, (float) translationZ + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
    model.render(null, 0.04F, 1.0F, 1.0F, 1.0F, 1.0F, 0.0625F);
    GL11.glPopMatrix();
}

From source file:com.minestellar.moon.world.SkyRendererMoon.java

License:Open Source License

@Override
public void render(float partialTicks, WorldClient world, Minecraft mc) {
    WorldProviderMoon gcProvider = null;

    if (world.provider instanceof WorldProviderMoon) {
        gcProvider = (WorldProviderMoon) world.provider;
    }/*from   w  w  w.  j av  a2 s. c o m*/

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(1, 1, 1);
    final Tessellator var23 = Tessellator.instance;
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glColor3f(0, 0, 0);
    GL11.glCallList(this.glSkyList);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.disableStandardItemLighting();
    float var10;
    float var11;
    float var12;

    float var20 = 0;

    if (gcProvider != null) {
        var20 = gcProvider.getStarBrightness(partialTicks);
    }

    if (var20 > 0.0F) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, var20);
        GL11.glCallList(this.starGLCallList);
    }

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    GL11.glPushMatrix();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    // SUN:
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 5F);
    GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
    var12 = 30.0F;
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.sunTexture);
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, 150.0D, -var12, 0.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, -var12, 1.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, var12, 1.0D, 1.0D);
    var23.addVertexWithUV(-var12, 150.0D, var12, 0.0D, 1.0D);
    var23.draw();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    GL11.glDisable(GL11.GL_BLEND);

    // EARTH:
    var12 = 50.0F;
    final float earthRotation = (float) (world.getSpawnPoint().posZ - mc.thePlayer.posZ) * 0.01F;
    GL11.glScalef(0.6F, 0.6F, 0.6F);
    GL11.glRotatef(earthRotation, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.earthTexture);
    world.getMoonPhase();
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, -400.0D, var12, 0, 1);
    var23.addVertexWithUV(var12, -400.0D, var12, 1, 1);
    var23.addVertexWithUV(var12, -400.0D, -var12, 1, 0);
    var23.addVertexWithUV(-var12, -400.0D, -var12, 0, 0);
    var23.draw();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(0.0F, 0.0F, 0.0F);
    final double var25 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon();

    if (var25 < 0.0D) {
        GL11.glPushMatrix();
        GL11.glTranslatef(0.0F, 12.0F, 0.0F);
        GL11.glCallList(this.glSkyList2);
        GL11.glPopMatrix();
        var10 = 1.0F;
        var11 = -((float) (var25 + 65.0D));
        var12 = -var10;
        var23.startDrawingQuads();
        var23.setColorRGBA_I(0, 255);
        var23.addVertex(-var10, var11, var10);
        var23.addVertex(var10, var11, var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(var10, var12, -var10);
        var23.addVertex(var10, var11, -var10);
        var23.addVertex(-var10, var11, -var10);
        var23.addVertex(var10, var12, -var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(var10, var11, var10);
        var23.addVertex(var10, var11, -var10);
        var23.addVertex(-var10, var11, -var10);
        var23.addVertex(-var10, var11, var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(var10, var12, -var10);
        var23.draw();
    }

    GL11.glColor3f(70F / 256F, 70F / 256F, 70F / 256F);

    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, -((float) (var25 - 16.0D)), 0.0F);
    GL11.glCallList(this.glSkyList2);
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
}

From source file:com.mrcrayfish.furniture.render.tileentity.BlenderRenderer.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_,
        int p_180535_9_) {
    TileEntityBlender blender = (TileEntityBlender) tileEntity;
    ItemStack[] ingredients = blender.getIngredients();

    GL11.glPushMatrix();/*  w ww .  j  av  a2s  .  co  m*/
    GL11.glTranslatef((float) posX + 0.5F, (float) posY + 0.2F, (float) posZ + 0.5F);
    GL11.glScalef(0.65F, 0.65F, 0.65F);
    entityFood.hoverStart = 0.0F;
    for (int i = 0; i < ingredients.length; i++) {
        if (ingredients[i] != null) {
            entityFood.setEntityItemStack(ingredients[i]);
            GL11.glRotatef(i * -90F, 0, 1, 0);
            GL11.glRotatef(blender.progress * 18F, 0, 1, 0);
            Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityFood, 0.0D, 0.2D, 0.0D,
                    0.0F, 0.0F);
        }
    }
    GL11.glPopMatrix();

    if (blender.isBlending() | blender.drinkCount > 0) {
        Tessellator tessellator = Tessellator.getInstance();
        GL11.glPushMatrix();
        GL11.glTranslatef((float) posX + 0.5F, (float) posY + 0.05F, (float) posZ + 0.5F);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glEnable(GL11.GL_BLEND);

        float alpha = blender.isBlending() ? (blender.progress / 200F) : (blender.drinkCount > 0 ? 1.0F : 0.0F);
        GL11.glColor4f(blender.currentRed / 255F, blender.currentGreen / 255F, blender.currentBlue / 255F,
                alpha);

        float height = blender.isBlending() ? 0.8F : (0.275F + (0.525F * (blender.drinkCount / 6F)));
        GL11.glBegin(GL11.GL_QUADS);

        // North Face
        GL11.glVertex3d(-0.2, 0.275, -0.2);
        GL11.glVertex3d(0.2, 0.275, -0.2);
        GL11.glVertex3d(0.2, height, -0.2);
        GL11.glVertex3d(-0.2, height, -0.2);

        // South Face
        GL11.glVertex3d(-0.2, 0.275, 0.2);
        GL11.glVertex3d(0.2, 0.275, 0.2);
        GL11.glVertex3d(0.2, height, 0.2);
        GL11.glVertex3d(-0.2, height, 0.2);

        // West Face
        GL11.glVertex3d(-0.2, 0.275, -0.2);
        GL11.glVertex3d(-0.2, 0.275, 0.2);
        GL11.glVertex3d(-0.2, height, 0.2);
        GL11.glVertex3d(-0.2, height, -0.2);

        // East Face
        GL11.glVertex3d(0.2, 0.275, -0.2);
        GL11.glVertex3d(0.2, 0.275, 0.2);
        GL11.glVertex3d(0.2, height, 0.2);
        GL11.glVertex3d(0.2, height, -0.2);

        // Top Face
        GL11.glVertex3d(-0.2, height, -0.2);
        GL11.glVertex3d(0.2, height, -0.2);
        GL11.glVertex3d(0.2, height, 0.2);
        GL11.glVertex3d(-0.2, height, 0.2);

        // Bottom Face
        GL11.glVertex3d(-0.2, 0.275, -0.2);
        GL11.glVertex3d(0.2, 0.275, -0.2);
        GL11.glVertex3d(0.2, 0.275, 0.2);
        GL11.glVertex3d(-0.2, 0.275, 0.2);

        GL11.glEnd();

        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F);

        GL11.glPopMatrix();
    }
}

From source file:com.mrcrayfish.furniture.render.tileentity.ChoppingBoardRenderer.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_,
        int p_180535_9_) {
    TileEntityChoppingBoard board = (TileEntityChoppingBoard) tileEntity;
    BlockChoppingBoard choppingBoard = (BlockChoppingBoard) tileEntity.getBlockType();
    int metadata = choppingBoard.getMetaFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));

    if (board.getFood() != null) {
        entityFood.setEntityItemStack(board.getFood());

        GL11.glPushMatrix();/* w  ww. j a  v  a  2 s  .  com*/
        this.entityFood.hoverStart = 0.0F;

        float xOffset = 0.0F;
        float zOffset = 0.0F;

        switch (metadata) {
        case 0:
            zOffset -= 0.1F;
            break;
        case 1:
            xOffset += 0.3F;
            zOffset += 0.2F;
            break;
        case 2:
            zOffset += 0.5F;
            break;
        case 3:
            xOffset -= 0.3F;
            zOffset += 0.2F;
            break;
        }

        GL11.glTranslatef((float) posX + 0.5F + xOffset, (float) posY + 0.02F, (float) posZ + 0.3F + zOffset);
        GL11.glRotatef(metadata * -90F, 0, 1, 0);
        GL11.glRotatef(180, 0, 1, 1);
        Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityFood, 0.0D, 0.0D, 0.075D, 0.0F,
                0.0F);
        GL11.glPopMatrix();
    }
}

From source file:com.mrcrayfish.furniture.render.tileentity.CookieRenderer.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_,
        int p_180535_9_) {
    GL11.glPushMatrix();//from   w ww .j  a  v a2s. co m
    this.entityItem.hoverStart = 0.0F;
    GL11.glTranslatef((float) posX + 0.5F, (float) posY + 0.05F, (float) posZ + 0.18F);
    GL11.glRotatef(180, 0, 1, 1);
    GL11.glScalef(0.9F, 0.9F, 0.9F);
    Block block = tileEntity.getBlockType();
    int metadata = block.getMetaFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
    for (int i = 0; i < metadata; i++) {
        Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityItem, 0.0D, 0.0D, 0.1D * i,
                0.0F, 0.0F);
    }
    GL11.glPopMatrix();
}

From source file:com.mrcrayfish.furniture.render.tileentity.MicrowaveRenderer.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_,
        int p_180535_9_) {
    TileEntityMicrowave microwave = (TileEntityMicrowave) tileEntity;
    Block block = tileEntity.getBlockType();
    int metadata = block.getMetaFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
    if (microwave.getItem() != null) {
        entityFood.setEntityItemStack(microwave.getItem());

        GL11.glPushMatrix();/* w  ww .  j  a  v  a2 s  .co  m*/
        this.entityFood.hoverStart = 0.0F;

        float xOffset = 0.0F;
        float zOffset = 0.0F;

        switch (metadata) {
        case 0:
            xOffset += 0.1F;
            break;
        case 1:
            xOffset += 0.2F;
            zOffset += 0.3F;
            break;
        case 2:
            xOffset -= 0.1F;
            zOffset += 0.4F;
            break;
        case 3:
            xOffset -= 0.2F;
            zOffset += 0.1F;
            break;
        }

        GL11.glTranslatef((float) posX + 0.5F + xOffset, (float) posY + 0.075F, (float) posZ + 0.3F + zOffset);
        GL11.glRotatef(metadata * -90F, 0, 1, 0);
        GL11.glRotatef(180, 0, 1, 1);
        Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityFood, 0.0D, 0.0D, 0.075D, 0.0F,
                0.0F);
        GL11.glPopMatrix();
    }
}

From source file:com.mrcrayfish.furniture.render.tileentity.PlateRenderer.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_,
        int p_180535_9_) {
    TileEntityPlate plate = (TileEntityPlate) tileEntity;
    if (plate.getFood() != null) {
        entityFood.setEntityItemStack(plate.getFood());

        GL11.glPushMatrix();//from  ww w . jav  a2s  .  com
        this.entityFood.hoverStart = 0.0F;

        float xOffset = 0.0F;
        float zOffset = 0.0F;

        switch (plate.getRotation()) {
        case 0:
            zOffset -= 0.1F;
            break;
        case 1:
            xOffset += 0.3F;
            zOffset += 0.2F;
            break;
        case 2:
            zOffset += 0.5F;
            break;
        case 3:
            xOffset -= 0.3F;
            zOffset += 0.2F;
            break;
        }

        GL11.glTranslatef((float) posX + 0.5F + xOffset, (float) posY + 0.05F, (float) posZ + 0.3F + zOffset);
        GL11.glRotatef(plate.getRotation() * -90F, 0, 1, 0);
        GL11.glRotatef(180, 0, 1, 1);
        Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityFood, 0.0D, 0.0D, 0.075D, 0.0F,
                0.0F);
        GL11.glPopMatrix();
    }
}