Java Code Examples for org.lwjgl.opengl.GL11.glRotatef()

The following are Jave code examples for showing how to use glRotatef() of the org.lwjgl.opengl.GL11 class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: trashjam2017   File: SlickCallableTest.java   View Source Code Vote up 6 votes
/**
 * Render the GL scene, this isn't efficient and if you know 
 * OpenGL I'm assuming you can see why. If not, you probably
 * don't want to use this feature anyway
 */
public void renderGL() {		
	FloatBuffer pos = BufferUtils.createFloatBuffer(4);
	pos.put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f}).flip();
	FloatBuffer red = BufferUtils.createFloatBuffer(4);
	red.put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f}).flip();

	GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
	GL11.glEnable(GL11.GL_LIGHT0);

	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_LIGHTING);
	
	GL11.glMatrixMode(GL11.GL_PROJECTION);
	GL11.glLoadIdentity();
	float h = (float) 600 / (float) 800;
	GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	GL11.glLoadIdentity();	
	GL11.glTranslatef(0.0f, 0.0f, -40.0f);	
	GL11.glRotatef(rot,0,1,1);		
	
	GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
	gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
}
 
Example 2
Project: BaseClient   File: SlickCallableTest.java   View Source Code Vote up 6 votes
/**
 * Render the GL scene, this isn't efficient and if you know 
 * OpenGL I'm assuming you can see why. If not, you probably
 * don't want to use this feature anyway
 */
public void renderGL() {		
	FloatBuffer pos = BufferUtils.createFloatBuffer(4);
	pos.put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f}).flip();
	FloatBuffer red = BufferUtils.createFloatBuffer(4);
	red.put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f}).flip();

	GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
	GL11.glEnable(GL11.GL_LIGHT0);

	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_LIGHTING);
	
	GL11.glMatrixMode(GL11.GL_PROJECTION);
	GL11.glLoadIdentity();
	float h = (float) 600 / (float) 800;
	GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	GL11.glLoadIdentity();	
	GL11.glTranslatef(0.0f, 0.0f, -40.0f);	
	GL11.glRotatef(rot,0,1,1);		
	
	GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
	gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
}
 
Example 3
Project: Halloween   File: ModelRendererPyramid.java   View Source Code Vote up 5 votes
@Override
public void renderWithRotation(float scale)
{
	if (!this.isHidden)
	{
		if (this.showModel)
		{
			if (!this.compiled)
			{
				this.compileDisplayList(scale);
			}

			GL11.glPushMatrix();
			GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);

			if (this.rotateAngleY != 0.0F)
			{
				GL11.glRotatef(this.rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F);
			}

			if (this.rotateAngleX != 0.0F)
			{
				GL11.glRotatef(this.rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F);
			}

			if (this.rotateAngleZ != 0.0F)
			{
				GL11.glRotatef(this.rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F);
			}

			GL11.glCallList(this.displayList);
			GL11.glPopMatrix();
		}
	}
}
 
Example 4
Project: pnc-repressurized   File: RenderTargetCircle.java   View Source Code Vote up 5 votes
public void render(double size, float partialTicks) {
    double renderRotationAngle = oldRotationAngle + (rotationAngle - oldRotationAngle) * partialTicks;
    BufferBuilder wr = Tessellator.getInstance().getBuffer();

    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);

    // GL11.glLineWidth((float)size * 20F);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);

    GL11.glRotatef((float) renderRotationAngle, 0, 0, 1);
    for (int j = 0; j < 2; j++) {
        wr.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION);
        for (int i = 0; i < PneumaticCraftUtils.circlePoints / 4; i++) {
            wr.pos(PneumaticCraftUtils.cos[i] * size, PneumaticCraftUtils.sin[i] * size, 0).endVertex();
            wr.pos(PneumaticCraftUtils.cos[i] * (size + 0.1D), PneumaticCraftUtils.sin[i] * (size + 0.1D), 0).endVertex();
        }
        Tessellator.getInstance().draw();

        if (renderAsTagged) {
            GL11.glColor4d(1, 0, 0, 1);
            wr.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION);
            for (int i = 0; i < PneumaticCraftUtils.circlePoints / 4; i++) {
                wr.pos(PneumaticCraftUtils.cos[i] * size, PneumaticCraftUtils.sin[i] * size, 0).endVertex();
            }
            for (int i = PneumaticCraftUtils.circlePoints / 4 - 1; i >= 0; i--) {
                wr.pos(PneumaticCraftUtils.cos[i] * (size + 0.1D), PneumaticCraftUtils.sin[i] * (size + 0.1D), 0).endVertex();
            }
            Tessellator.getInstance().draw();
            GL11.glColor4d(1, 1, 0, 0.5);
        }

        GL11.glRotatef(180, 0, 0, 1);
    }

    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 5
Project: betaexpansion   File: RenderPlayer.java   View Source Code Vote up 5 votes
protected void func_22017_a(EntityPlayer entityplayer, float f, float f1, float f2)
{
    if(entityplayer.isEntityAlive() && entityplayer.isPlayerSleeping())
    {
        GL11.glRotatef(entityplayer.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(getDeathMaxRotation(entityplayer), 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(270F, 0.0F, 1.0F, 0.0F);
    } else
    {
        super.rotateCorpse(entityplayer, f, f1, f2);
    }
}
 
Example 6
Project: pnc-repressurized   File: RenderAphorismTile.java   View Source Code Vote up 5 votes
@Override
public void render(TileEntityAphorismTile te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    PneumaticCraftUtils.rotateMatrixByMetadata(te.getBlockMetadata());
    GL11.glTranslatef(0, 1, 0.5F - BBConstants.APHORISM_TILE_THICKNESS - 0.01F);
    String[] textLines = te.getTextLines();
    int lineWidth = getMaxLineWidth(textLines);  // TODO we don't need to calculate this every single tick
    int lineHeight = 10 * textLines.length;
    float textScale = Math.min(14 / 16F / lineWidth, 14 / 16F / lineHeight);
    GL11.glScalef(textScale, textScale, textScale);
    GL11.glRotatef(te.textRotation * 90, 0, 0, 1);
    int editedLine = -1;

    if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiAphorismTile) {
        GuiAphorismTile gui = (GuiAphorismTile) FMLClientHandler.instance().getClient().currentScreen;
        if (gui.tile == te && (gui.updateCounter & 0x0f) < 8) {
            editedLine = gui.cursorY;
        }
    }

    FontRenderer f = Minecraft.getMinecraft().getRenderManager().getFontRenderer();
    for (int i = 0; i < textLines.length; i++) {
        String textLine = textLines[i];
        if (editedLine == i) textLine = ">" + textLine + "<";
        f.drawString(textLine, -f.getStringWidth(textLine) / 2, -(textLines.length * 10) / 2 + i * 10 + 1, 0xFF000000);
    }

    GL11.glPopMatrix();
}
 
Example 7
Project: betaexpansion   File: ModelRenderer.java   View Source Code Vote up 5 votes
public void postRender(float f)
{
    if(field_1402_i)
    {
        return;
    }
    if(!showModel)
    {
        return;
    }
    if(!compiled)
    {
        compileDisplayList(f);
    }
    if(rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F)
    {
        GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f);
        if(rotateAngleZ != 0.0F)
        {
            GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F);
        }
        if(rotateAngleY != 0.0F)
        {
            GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F);
        }
        if(rotateAngleX != 0.0F)
        {
            GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F);
        }
    } else
    if(rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F)
    {
        GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f);
    }
}
 
Example 8
Project: BaseClient   File: Shaders.java   View Source Code Vote up 4 votes
public static void preCelestialRotate()
{
    setUpPosition();
    GL11.glRotatef(sunPathRotation * 1.0F, 0.0F, 0.0F, 1.0F);
    checkGLError("preCelestialRotate");
}
 
Example 9
Project: pnc-repressurized   File: RenderEntityVortex.java   View Source Code Vote up 4 votes
private void renderGust() {
    byte b0 = 0;
    //float f2 = 0.0F;
    //float f3 = 0.5F;
    //float f4 = (0 + b0 * 10) / 16.0F;
    // float f5 = (5 + b0 * 10) / 16.0F;
    float f6 = 0.0F;
    float f7 = 0.15625F;
    float f8 = (5 + b0 * 10) / 16.0F;
    float f9 = (10 + b0 * 10) / 16.0F;
    float f10 = 0.05625F;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
    GL11.glScalef(f10, f10, f10);
    GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
    GL11.glNormal3f(f10, 0.0F, 0.0F);
    BufferBuilder wr = Tessellator.getInstance().getBuffer();
    wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);

    wr.pos(-7.0D, -2.0D, -2.0D).tex(f6, f8).endVertex();
    wr.pos(-7.0D, -2.0D, 2.0D).tex(f7, f8).endVertex();
    wr.pos(-7.0D, 2.0D, 2.0D).tex(f7, f9).endVertex();
    wr.pos(-7.0D, 2.0D, -2.0D).tex(f6, f9).endVertex();

    double start = 0d;
    double end = 1 / 16d;
    wr.pos(-7.0D, -2.0D, -2.0D).tex(start, start).endVertex();
    wr.pos(-7.0D, -2.0D, 2.0D).tex(start, end).endVertex();
    wr.pos(-7.0D, 2.0D, 2.0D).tex(end, end).endVertex();
    wr.pos(-7.0D, 2.0D, -2.0D).tex(end, start).endVertex();
    Tessellator.getInstance().draw();
    GL11.glNormal3f(-f10, 0.0F, 0.0F);

    wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
    wr.pos(-7.0D, 2.0D, -2.0D).tex(f6, f8).endVertex();
    wr.pos(-7.0D, 2.0D, 2.0D).tex(f7, f8).endVertex();
    wr.pos(-7.0D, -2.0D, 2.0D).tex(f7, f9).endVertex();
    wr.pos(-7.0D, -2.0D, -2.0D).tex(f6, f9).endVertex();
    Tessellator.getInstance().draw();

}
 
Example 10
Project: MineDonate   File: GuiItemEntryOfEntityMerch.java   View Source Code Vote up 4 votes
private void renderEntity(int p_147046_0_, int p_147046_1_, float scale, float p_147046_3_, float p_147046_4_, float z, float rotate, EntityLivingBase p_147046_5_) {
	
	GL11.glEnable(2903);
	GL11.glPushMatrix();
	GL11.glTranslatef((float) p_147046_0_, (float) p_147046_1_, z);//50.0F
	GL11.glScalef((-scale), scale, scale);
	GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
	
	float var6 = p_147046_5_.renderYawOffset;
	float var7 = p_147046_5_.rotationYaw;
	float var8 = p_147046_5_.rotationPitch;
	float var9 = p_147046_5_.prevRotationYawHead;
	float var10 = p_147046_5_.rotationYawHead;
	
	RenderHelper.enableStandardItemLighting();

	GL11.glRotatef(-((float) Math.atan((double) (p_147046_4_ / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
	
	p_147046_5_.posX = p_147046_5_.posY = p_147046_5_.posZ = 0;
	p_147046_5_.renderYawOffset = (float) Math.atan((double) (p_147046_3_ / 40.0F)) * rotate;
	p_147046_5_.rotationYaw = (float) Math.atan((double) (p_147046_3_ / 40.0F)) * 40.0F;
	p_147046_5_.rotationPitch = -((float) Math.atan((double) (p_147046_4_ / 40.0F))) * 20.0F;
	p_147046_5_.rotationYawHead = (float) Math.atan((double) (p_147046_3_ / 40.0F)) * rotate;
	p_147046_5_.prevRotationYawHead = 360f ;
	
	RenderManager.instance.playerViewY = 180.0F;
	
	RenderManager.instance.renderEntityWithPosYaw(p_147046_5_, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
	
	p_147046_5_.renderYawOffset = var6;
	p_147046_5_.rotationYaw = var7;
	p_147046_5_.rotationPitch = var8;
	p_147046_5_.prevRotationYawHead = var9;
	p_147046_5_.rotationYawHead = var10;
	
	GL11.glPopMatrix();
	
	RenderHelper.disableStandardItemLighting();
	
	GL11.glDisable(2903);

	OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
	
	GL11.glDisable(3553);
	
	OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
Example 11
Project: Towan   File: ImmediateModeOGLRenderer.java   View Source Code Vote up 4 votes
/**
 * @see org.newdawn.slick.opengl.renderer.SGL#glRotatef(float, float, float, float)
 */
public void glRotatef(float angle, float x, float y, float z) {
	GL11.glRotatef(angle, x, y, z);
}
 
Example 12
Project: Progetto-C   File: ImmediateModeOGLRenderer.java   View Source Code Vote up 4 votes
/**
 * @see org.newdawn.slick.opengl.renderer.SGL#glRotatef(float, float, float, float)
 */
public void glRotatef(float angle, float x, float y, float z) {
	GL11.glRotatef(angle, x, y, z);
}
 
Example 13
Project: Mods   File: RenderRocket.java   View Source Code Vote up 4 votes
@Override
public void doRender(EntityRocket entity, double x, double y, double z, float yaw, float partialTick) {
	GL11.glPushMatrix();
	GL11.glTranslatef((float) x, (float) y, (float) z);
	GL11.glColor4f(0.7F, 0.7F, 0.7F, 1F);
	GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTick - 90.0F,
			0.0F, 1.0F, 0.0F);
	GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTick, 0.0F,
			0.0F, 1.0F);

	bindEntityTexture(entity);

	// GL11.glTranslatef((float)entity.posX, (float)entity.posY,
	// entity.posZ);
	if (((EntityProjectileBase) entity).getCritical() == 2) {
		GlStateManager.disableTexture2D();
		GlStateManager.disableLighting();
		ClientProxy.setColor(TF2Util.getTeamColor(((EntityProjectileBase) entity).shootingEntity), 1f, 0f, 0f, 1f);
		model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
		GlStateManager.enableTexture2D();
		GlStateManager.enableLighting();
	} else
		model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);

	/*
	 * GL11.glScalef(1.5f, 1.5f, 1.5f); GL11.glEnable(GL11.GL_BLEND);
	 * //GL11.glDisable(GL11.GL_ALPHA_TEST); OpenGlHelper.glBlendFunc(770,
	 * 771, 1, 0);
	 * 
	 * char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536;
	 * OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
	 * (float)j / 1.0F, (float)k / 1.0F);
	 * 
	 * model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
	 * GL11.glDisable(GL11.GL_BLEND); // GL11.glEnable(GL11.GL_ALPHA_TEST);
	 */
	GL11.glColor4f(1F, 1F, 1F, 1F);
	GL11.glPopMatrix();
	/*
	 * IIcon iicon = TF2EventBusListener.pelletIcon;
	 * 
	 * if (iicon != null) { GL11.glPushMatrix();
	 * GL11.glTranslatef((float)x,(float) y,(float) z);
	 * GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F,
	 * 0.5F); this.bindTexture(TextureMap.locationItemsTexture); Tessellator
	 * tessellator = Tessellator.instance;
	 * 
	 * float f = iicon.getMinU(); float f1 = iicon.getMaxU(); float f2 =
	 * iicon.getMinV(); float f3 = iicon.getMaxV(); float f4 = 1.0F; float
	 * f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F -
	 * this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	 * GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
	 * tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F,
	 * 0.0F); tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F
	 * - f6), 0.0D, (double)f, (double)f3);
	 * tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6),
	 * 0.0D, (double)f1, (double)f3);
	 * tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6),
	 * 0.0D, (double)f1, (double)f2);
	 * tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6),
	 * 0.0D, (double)f, (double)f2); tessellator.draw();
	 * GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix();
	 * 
	 * }
	 */

}
 
Example 14
Project: betaexpansion   File: Render.java   View Source Code Vote up 4 votes
private void renderEntityOnFire(Entity entity, double d, double d1, double d2, 
        float f)
{
    GL11.glDisable(2896 /*GL_LIGHTING*/);
    int i = Block.fire.blockIndexInTexture;
    int j = (i & 0xf) << 4;
    int k = i & 0xf0;
    float f1 = (float)j / 256F;
    float f3 = ((float)j + 15.99F) / 256F;
    float f5 = (float)k / 256F;
    float f7 = ((float)k + 15.99F) / 256F;
    GL11.glPushMatrix();
    GL11.glTranslatef((float)d, (float)d1, (float)d2);
    float f9 = entity.width * 1.4F;
    GL11.glScalef(f9, f9, f9);
    loadTexture("/terrain.png");
    Tessellator tessellator = Tessellator.instance;
    float f10 = 0.5F;
    float f11 = 0.0F;
    float f12 = entity.height / f9;
    float f13 = (float)(entity.posY - entity.boundingBox.minY);
    GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(0.0F, 0.0F, -0.3F + (float)(int)f12 * 0.02F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float f14 = 0.0F;
    int l = 0;
    tessellator.startDrawingQuads();
    while(f12 > 0.0F) 
    {
        float f2;
        float f4;
        float f6;
        float f8;
        if(l % 2 == 0)
        {
            f2 = (float)j / 256F;
            f4 = ((float)j + 15.99F) / 256F;
            f6 = (float)k / 256F;
            f8 = ((float)k + 15.99F) / 256F;
        } else
        {
            f2 = (float)j / 256F;
            f4 = ((float)j + 15.99F) / 256F;
            f6 = (float)(k + 16) / 256F;
            f8 = ((float)(k + 16) + 15.99F) / 256F;
        }
        if((l / 2) % 2 == 0)
        {
            float f15 = f4;
            f4 = f2;
            f2 = f15;
        }
        tessellator.addVertexWithUV(f10 - f11, 0.0F - f13, f14, f4, f8);
        tessellator.addVertexWithUV(-f10 - f11, 0.0F - f13, f14, f2, f8);
        tessellator.addVertexWithUV(-f10 - f11, 1.4F - f13, f14, f2, f6);
        tessellator.addVertexWithUV(f10 - f11, 1.4F - f13, f14, f4, f6);
        f12 -= 0.45F;
        f13 -= 0.45F;
        f10 *= 0.9F;
        f14 += 0.03F;
        l++;
    }
    tessellator.draw();
    GL11.glPopMatrix();
    GL11.glEnable(2896 /*GL_LIGHTING*/);
}
 
Example 15
Project: EMC   File: IGL11.java   View Source Code Vote up 4 votes
public static void glRotatef(float angle, float x, float y, float z) {
	GL11.glRotatef(angle, x, y, z);
}
 
Example 16
Project: TFCPrimitiveTech   File: RenderSharpStone.java   View Source Code Vote up 4 votes
public void render(EntityProjectileSharpStone entity, double x, double y, double z, float par8, float par9)
{
	bindEntityTexture(entity);
	GL11.glPushMatrix();
	GL11.glTranslatef((float)x, (float)y, (float)z);
	GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
	GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
	Tessellator tessellator = Tessellator.instance;
	float fx1 = 0.0F;
	float fx2 = 8 / 32.0F;
	float fy1 = 0.0F;
	float fy2 = 8 / 32.0F;

	float f10 = 0.05625F;

	GL11.glEnable(GL12.GL_RESCALE_NORMAL);

	GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
	GL11.glScalef(f10, f10, f10);
	GL11.glTranslatef(-4.0F, 0.0F, 0.0F);

	for (int i = 0; i < 2; ++i)
	{
		GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
		GL11.glNormal3f(0.0F, 0.0F, f10);
		tessellator.startDrawingQuads();
		tessellator.addVertexWithUV(-2.0D, -2.0D, 0.0D, fx1, fy1);
		tessellator.addVertexWithUV(2.0D, -2.0D, 0.0D, fx2, fy1);
		tessellator.addVertexWithUV(2.0D, 2.0D, 0.0D, fx2, fy2);
		tessellator.addVertexWithUV(-2.0D, 2.0D, 0.0D, fx1, fy2);
		tessellator.draw();
	}

	for (int i = 0; i < 2; ++i)
	{
		GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
		GL11.glNormal3f(0.0F, 0.0F, f10);
		tessellator.startDrawingQuads();
		tessellator.addVertexWithUV(0.0D, -2.0D, -2.0D, fx1, fy1);
		tessellator.addVertexWithUV(0.0D, -2.0D, 2.0D, fx2, fy1);
		tessellator.addVertexWithUV(0.0D, 2.0D, 2.0D, fx2, fy2);
		tessellator.addVertexWithUV(0.0D, 2.0D, -2.0D, fx1, fy2);
		tessellator.draw();
	}
	
	
	GL11.glDisable(GL12.GL_RESCALE_NORMAL);
	GL11.glPopMatrix();
}
 
Example 17
Project: Backmemed   File: Shaders.java   View Source Code Vote up 4 votes
public static void preCelestialRotate()
{
    GL11.glRotatef(sunPathRotation * 1.0F, 0.0F, 0.0F, 1.0F);
    checkGLError("preCelestialRotate");
}
 
Example 18
Project: minecraft-quiverbow   File: Render_Projectile.java   View Source Code Vote up 4 votes
public void doRender_TossedItem(Entity shot, double x, double y, double z, int type)
 {
     GL11.glPushMatrix();
      this.bindEntityTexture(shot);
      GL11.glTranslatef((float)x, (float)y, (float)z);
      
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      
      float f2 = 0.5f;

GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
      
      IIcon icon = Items.baked_potato.getIconFromDamage(0);	// Default, to be overridden with the actual thing
      
      if (type == 1) { icon = Items.gold_nugget.getIconFromDamage(0); }
      else if (type == 2) { icon = Items.glass_bottle.getIconFromDamage(0); }
      else if (type == 3) { icon = Items.baked_potato.getIconFromDamage(0); }
      else if (type == 4) { icon = Items.melon_seeds.getIconFromDamage(0); }
      else if (type == 5) { icon = Items.glowstone_dust.getIconFromDamage(0); }
      else if (type == 6) { icon = Items.water_bucket.getIconFromDamage(0); }
      else if (type == 7) { icon = Items.snowball.getIconFromDamage(0); }
      
      Tessellator tessellator = Tessellator.instance;
      
float f3 = icon.getMinU();
      float f4 = icon.getMaxU();
      float f5 = icon.getMinV();
      float f6 = icon.getMaxV();
      float f7 = 1.0F;
      float f8 = 0.5F;
      float f9 = 0.25F;
      
      GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
      
      tessellator.startDrawingQuads();
       tessellator.setNormal(0.0F, 1.0F, 0.0F);
       tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
       tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
       tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
       tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
      tessellator.draw();
      
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
     GL11.glPopMatrix();
 }
 
Example 19
Project: minecraft-quiverbow   File: Render_Projectile.java   View Source Code Vote up 4 votes
public void doRender_Arrow(_ProjectileBase shot, double x, double y, double z, float par8, float par9)
{
    this.bindEntityTexture(shot);
   
    GL11.glPushMatrix();
    GL11.glTranslatef((float)x, (float)y, (float)z);
    GL11.glRotatef(shot.prevRotationYaw + (shot.rotationYaw - shot.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(shot.prevRotationPitch + (shot.rotationPitch - shot.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
    
    Tessellator tessellator = Tessellator.instance;
    
    byte b0 = 0;
    float f2 = 0.0F;
    float f3 = 0.5F;
    float f4 = (float)(0 + b0 * 10) / 32.0F;
    float f5 = (float)(5 + b0 * 10) / 32.0F;
    float f6 = 0.0F;
    float f7 = 0.15625F;
    float f8 = (float)(5 + b0 * 10) / 32.0F;
    float f9 = (float)(10 + b0 * 10) / 32.0F;
    float f10 = 0.05625F;
   
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    
    float f11 = (float) shot.arrowShake - par9;

    if (f11 > 0.0F)
    {
        float f12 = -MathHelper.sin(f11 * 3.0F) * f11;
        GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F);
    }

    GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
    GL11.glScalef(f10, f10, f10);
    GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
    GL11.glNormal3f(f10, 0.0F, 0.0F);
    
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
    tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
    tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
    tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);
    tessellator.draw();
   
    GL11.glNormal3f(-f10, 0.0F, 0.0F);
    
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8);
    tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8);
    tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9);
    tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9);
    tessellator.draw();

    for (int i = 0; i < 4; ++i)
    {
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glNormal3f(0.0F, 0.0F, f10);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
        tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
        tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
        tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
        tessellator.draw();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 20
Project: Halloween   File: ModelRendererPyramid.java   View Source Code Vote up 4 votes
@Override
public void postRender(float scale)
{
	if (!this.isHidden)
	{
		if (this.showModel)
		{
			if (!this.compiled)
			{
				this.compileDisplayList(scale);
			}

			if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F)
			{
				if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F)
				{
					GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
				}
			}
			else
			{
				GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);

				if (this.rotateAngleZ != 0.0F)
				{
					GL11.glRotatef(this.rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F);
				}

				if (this.rotateAngleY != 0.0F)
				{
					GL11.glRotatef(this.rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F);
				}

				if (this.rotateAngleX != 0.0F)
				{
					GL11.glRotatef(this.rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F);
				}
			}
		}
	}
}