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.stormister.rediscovered.RenderBlockChair.java

License:Open Source License

@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -1.5F, -0.5F);
    GL11.glScalef(1.0F, 1.0F, 1.0F);/*from w w w.j  a  v a  2  s.  com*/
    TileEntityRendererDispatcher.instance.renderTileEntityAt(this.egg, 0.0D, 1.0D, 0.0D, 0.0F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}

From source file:com.stormister.rediscovered.RenderBlockLecternOpen.java

License:Open Source License

@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -3.0F, -0.5F);
    GL11.glScalef(1.0F, 1.0F, 1.0F);/*from   ww  w  . ja  v a 2s . c  o  m*/
    TileEntityRendererDispatcher.instance.renderTileEntityAt(this.egg, 0.0D, 1.0D, 0.0D, 0.0F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}

From source file:com.stormister.rediscovered.RenderTileEntityChair.java

License:Open Source License

public void renderAModelAt(TileEntityChair tile, double d, double d1, double d2, float f) {

    int rotation = 0;
    if (tile != null && tile.hasWorldObj()) {
        rotation = tile.getBlockMetadata();
    }// ww w.j  a v  a 2 s.  co  m
    this.bindTexture(field_110871_a);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
    model.renderAll();
    GL11.glPopMatrix();
    //end
}

From source file:com.stormister.rediscovered.RenderTileEntityLockedChest.java

License:Open Source License

public void renderAModelAt(TileEntityLockedChest tile, double d, double d1, double d2, float f) {

    int rotation = 0;
    if (tile != null && tile.hasWorldObj()) {
        rotation = tile.getBlockMetadata();
    }// w ww .  ja  v a  2  s.c o m
    this.bindTexture(field_110871_a);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
    model.renderAll();
    GL11.glPopMatrix(); //end
}

From source file:com.stormister.rediscovered.RenderTileEntityRedEgg.java

License:Open Source License

@Override
public void renderTileEntityAt(TileEntity tile, double d, double d1, double d2, float f) {
    GL11.glPushMatrix();//from  w ww. ja  v a 2s .  c  om
    GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
    GL11.glRotatef(180, 0.0F, 0.0F, 1F);
    this.bindTexture(field_110871_a);
    GL11.glPushMatrix();
    this.model.renderAll();
    GL11.glPopMatrix();
    GL11.glPopMatrix(); //end
}

From source file:com.stormister.rediscovered.RenderTileEntitySpikes.java

License:Open Source License

public void renderAModelAt(TileEntitySpikes tile, double d, double d1, double d2, float f) {

    int rotation = 0;
    if (tile != null && tile.hasWorldObj()) {
        rotation = tile.getBlockMetadata();
    }/*from  w  ww. jav  a  2  s. c  o  m*/
    this.bindTexture(field_110871_a);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);

    model.renderAll();
    GL11.glPopMatrix();
    //end
}

From source file:com.stormister.rediscovered.RenderTileEntitySpikesSide.java

License:Open Source License

public void renderAModelAt(TileEntitySpikesSide tile, double d, double d1, double d2, float f) {

    int rotation = 0;
    if (tile != null && tile.hasWorldObj()) {
        rotation = tile.getBlockMetadata();
    }//from   ww w .  ja v  a 2  s. co  m
    this.bindTexture(field_110871_a);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
    model.renderAll();
    GL11.glPopMatrix();
    //end
}

From source file:com.stormister.rediscovered.RenderTileEntityTable.java

License:Open Source License

/**
 * Renders the TileEntity for the chest at a position.
 *///from w  ww .  ja  v a 2 s  .co m
public void render(TileEntityTable par1TileEntityChest, double par2, double par4, double par6, float par8) {
    int i;
    this.bindTexture(field_110871_a);

    if (!par1TileEntityChest.hasWorldObj()) {
        i = 0;
    } else {
        Block block = par1TileEntityChest.getBlockType();
        i = par1TileEntityChest.getBlockMetadata();

        if (block instanceof BlockTable && i == 0) {
            i = par1TileEntityChest.getBlockMetadata();
        }
    }
    ModelTable modelchest;
    modelchest = this.chestModel;
    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glTranslatef((float) par2, (float) par4 + 1.0F, (float) par6 + 1.0F);
    GL11.glScalef(1.0F, -1.0F, -1.0F);
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    short short1 = 0;

    GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    float f1 = par1TileEntityChest.prevLidAngle
            + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;
    float f2;
    f1 = 1.0F - f1;
    f1 = 1.0F - f1 * f1 * f1;
    modelchest.renderAll();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    //***********************************************
    //RENDERS ITEM ON TABLE
    //***********************************************

    //            ItemStack itemstack = par1TileEntityChest.getTopItemStacks();
    //
    //            if (itemstack != null)
    //            {
    //                EntityItem entityitem = new EntityItem(par1TileEntityChest.worldObj, 0.0D, 0.0D, 0.0D, itemstack);
    //                entityitem.getEntityItem().stackSize = 1;
    //                entityitem.hoverStart = 0.0F;
    //                GL11.glPushMatrix();
    //                GL11.glTranslatef(-0.453125F * (float)Direction.offsetX[par1TileEntityChest.hangingDirection], -0.18F, -0.453125F * (float)Direction.offsetZ[par1TileEntityChest.hangingDirection]);
    //                GL11.glRotatef(180.0F + par1TileEntityChest.rotationYaw, 0.0F, 1.0F, 0.0F);
    //                GL11.glRotatef((float)(-90 * par1TileEntityChest.getRotation()), 0.0F, 0.0F, 1.0F);
    //                RenderItem.renderInFrame = true;
    //                RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
    //                RenderItem.renderInFrame = false;
    //                GL11.glPopMatrix();
    //            }
}

From source file:com.teambrmodding.neotech.client.renderers.tiles.TileRenderHelper.java

License:Creative Commons License

protected void alignRendering(EnumFacing side, EnumFacing orientation, LocationDouble position) {
    GL11.glTranslated(position.x + 0.5F, position.y + 0.5F, position.z + 0.5F); // We align the rendering on the center of the block
    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
    GL11.glRotatef(this.getRotationYForSide(side, orientation), 0.0F, 1.0F, 0.0F); // We rotate it so it face the right face
    GL11.glRotatef(this.getRotationXForSide(side), 1.0F, 0.0F, 0.0F);
    GL11.glTranslated(-0.5F, -0.5F, -0.5f);
}

From source file:com.theoriginalbit.moarperipherals.client.render.RendererItemSonic.java

License:Apache License

@Override
protected void manipulateEntityRender(ItemStack stack) {
    float scale = 0.145f;
    GL11.glScalef(scale, scale, scale);//  w w w. j  ava  2 s. com
    GL11.glRotatef(180, 1, 0, 0);
    GL11.glTranslatef(0f, -1f, 0f);
}