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

The following are Jave code examples for showing how to use glPopMatrix() 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: SlickCallable.java   View Source Code Vote up 6 votes
/**
 * Leave a safe block ensuring that all of Slick's OpenGL state is
 * restored since the last enter.
 */
public static void leaveSafeBlock() 
{
	if (!inSafe) {
		return;
	}

	GL11.glMatrixMode(GL11.GL_PROJECTION);
	GL11.glPopMatrix();
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	GL11.glPopMatrix();
	GL11.glPopClientAttrib();
	GL11.glPopAttrib();
	
	if (lastUsed != null) {
		lastUsed.bind();
	} else {
		TextureImpl.bindNone();
	}
	
	inSafe = false;
}
 
Example 2
Project: ObsidianSuite   File: PartRotation.java   View Source Code Vote up 6 votes
public void rotateLocal(float delta, int dim)
{
	GL11.glPushMatrix();
	GL11.glLoadIdentity();
	rotate();
	switch(dim)
	{
	case 0: GL11.glRotated(delta,1,0,0); break;
	case 1: GL11.glRotated(delta,0,1,0); break;
	case 2: GL11.glRotated(delta,0,0,1); break;
	}

	GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, rotationMatrix);
	updateRotationAnglesFromMatrix();
	GL11.glPopMatrix();
}
 
Example 3
Project: SerenityCE   File: RenderUtilities.java   View Source Code Vote up 6 votes
public static void drawRect(final float x1, final float y1, final float x2,
                            final float y2, final int colour) {
    final float f = (colour >> 24 & 0xFF) / 255F;
    final float f1 = (colour >> 16 & 0xFF) / 255F;
    final float f2 = (colour >> 8 & 0xFF) / 255F;
    final float f3 = (colour & 0xFF) / 255F;

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);

    GL11.glPushMatrix();
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2d(x2, y1);
    GL11.glVertex2d(x1, y1);
    GL11.glVertex2d(x1, y2);
    GL11.glVertex2d(x2, y2);
    GL11.glEnd();
    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 4
Project: KraftigAudio   File: RadioButtons.java   View Source Code Vote up 6 votes
@Override
public void render(float alpha)
{
    GL11.glPushMatrix();
    GL11.glTranslatef(pos.x, pos.y, 0.0F);
    GL11.glLineWidth(1.0F);
    float color = Main.instance().getFocus() == this ? 0.75F : 1.0F;
    GL11.glColor4f(color, color, 1.0F, alpha);
    GL11.glBegin(value ? GL11.GL_TRIANGLE_FAN : GL11.GL_LINE_LOOP);
    for (float t = 0.0F; t < T_END; t += DT)
    {
        Vec2 p = Util.squareDir(t).normalize().mult(radius);
        GL11.glVertex2f(p.x, p.y);
    }
    GL11.glEnd();
    GL11.glPopMatrix();
}
 
Example 5
Project: EMC   File: RenderUtils.java   View Source Code Vote up 6 votes
public static void drawCircle(int xx, int yy, int radius, int col) {
	float f = (col >> 24 & 0xFF) / 255.0F;
	float f2 = (col >> 16 & 0xFF) / 255.0F;
	float f3 = (col >> 8 & 0xFF) / 255.0F;
	float f4 = (col & 0xFF) / 255.0F;
	GL11.glPushMatrix();
	GL11.glEnable(3042);
	GL11.glDisable(3553);
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(2848);
	GL11.glShadeModel(7425);
	GL11.glBegin(2);
	for (int i = 0; i < 70; i++) {
		float x = (float) (radius * Math.cos(i * 0.08975979010256552D));
		float y = (float) (radius * Math.sin(i * 0.08975979010256552D));
		GL11.glColor4f(f2, f3, f4, f);
		GL11.glVertex2f(xx + x, yy + y);
	}
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	GL11.glEnd();
	GL11.glEnable(3553);
	GL11.glDisable(3042);
	GL11.glDisable(2848);
	GL11.glPopMatrix();
}
 
Example 6
Project: ObsidianSuite   File: Bend_Animator.java   View Source Code Vote up 5 votes
/**
 * Test to see if a ray insects with the parent part of the bend.
 */
public Double testRayParent()
{
    GL11.glPushMatrix();
    move();
    Double t = testRay(RayTrace.getRayTrace(), getParentBendParts());
    GL11.glPopMatrix();
    return t;
}
 
Example 7
Project: EMC   File: RenderUtils.java   View Source Code Vote up 5 votes
public static void drawFilledCircle(int xx, int yy, float radius, int col) {
	float f = (col >> 24 & 0xFF) / 255.0F;
	float f2 = (col >> 16 & 0xFF) / 255.0F;
	float f3 = (col >> 8 & 0xFF) / 255.0F;
	float f4 = (col & 0xFF) / 255.0F;
	GL11.glPushMatrix();
	GL11.glEnable(3042);
	GL11.glDisable(3553);
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(2848);
	GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
	GL11.glBegin(6);

	for (int i = 0; i < 50; i++) {
		float x = (float) (radius * Math.sin(i * 0.12566370614359174D));
		float y = (float) (radius * Math.cos(i * 0.12566370614359174D));
		GL11.glColor4f(f2, f3, f4, f);
		GL11.glVertex2f(xx + x, yy + y);
	}

	GL11.glEnd();
	GL11.glEnable(3553);
	GL11.glDisable(3042);
	GL11.glDisable(2848);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	GL11.glPopMatrix();
}
 
Example 8
Project: Backmemed   File: RenderUtils.java   View Source Code Vote up 5 votes
public static void drawPlayerESP(double d, double d1, double d2, EntityPlayer ep, double e, double f)
{
	if(!(ep instanceof EntityPlayerSP))
	{
        GL11.glPushMatrix();
        GL11.glEnable(3042);
        if(Wrapper.getFriends().isFriend(ep.getName())) {
        	GL11.glColor4f(0.0F, 1F, 0.0F, 0.15F);
        }else{
        	GL11.glColor4f(0.7F, 0.0F, 0.0F, 0.15F);
        }
        GL11.glPushMatrix();
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_DEPTH_TEST);
        GL11.glDepthMask(false);
        GL11.glLineWidth(1.0F);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glEnable(GL11.GL_LINE_SMOOTH);
        drawBoundingBox(new AxisAlignedBB(d - f, d1 + 0.1, d2 - f, d + f, d1 + e + 0.25, d2 + f));
        if(Wrapper.getFriends().isFriend(ep.getName())) {
        	GL11.glColor4f(0.0F, 1F, 0.0F, 1F);
        }else{
        	GL11.glColor4f(0.7F, 0.0F, 0.0F, 1F);
        }
        drawOutlinedBoundingBox(new AxisAlignedBB(d - f, d1 + 0.1, d2 - f, d + f, d1 + e + 0.25, d2 + f));
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_LINE_SMOOTH);
        GL11.glDisable(3042);
        GL11.glPopMatrix();
	}
}
 
Example 9
Project: Defier   File: RenderDefierItem.java   View Source Code Vote up 5 votes
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
	GL11.glPushMatrix();
	GL11.glTranslated(0.5, .5, .5);
	GL11.glScalef(0.7F, 0.7F, 0.7F);
	GL11.glColor4f(0f, 0f, 0f, 1f);
	ResourceLocation rL = new ResourceLocation(Defier.MODID + ":textures/blocks/blank.png");
	Minecraft.getMinecraft().getTextureManager().bindTexture(rL);
	GL11.glCallList(ClientProxy.defierSphereIdOutside);
	GL11.glCallList(ClientProxy.defierSphereIdInside);
	GL11.glPopMatrix();
	GL11.glColor4f(1f, 1f, 1f, 1f);
}
 
Example 10
Project: pnc-repressurized   File: GuiUnitProgrammer.java   View Source Code Vote up 5 votes
protected void drawBorder(IProgWidget widget, int color) {
    GL11.glPushMatrix();
    GL11.glTranslated(widget.getX() + guiLeft, widget.getY() + guiTop, 0);
    GL11.glScaled(0.5, 0.5, 1);
    drawVerticalLine(0, 0, widget.getHeight(), color);
    drawVerticalLine(widget.getWidth(), 0, widget.getHeight(), color);
    drawHorizontalLine(widget.getWidth(), 0, 0, color);
    drawHorizontalLine(widget.getWidth(), 0, widget.getHeight(), color);
    GL11.glPopMatrix();
}
 
Example 11
Project: ObsidianSuite   File: TimelineGui.java   View Source Code Vote up 5 votes
@Override
public void processRay()
{
    GL11.glPushMatrix();
    super.processRay();
    GL11.glPopMatrix();
    controller.checkFramePartHighlighting();
}
 
Example 12
Project: Mods   File: RenderBall.java   View Source Code Vote up 4 votes
@Override
public void doRender(EntityBall entity, double x, double y, double z, float yaw, float partialTick) {
	GL11.glPushMatrix();
	GL11.glTranslatef((float) x, (float) y + entity.height / 2, (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 (entity.getCritical() == 2) {
		// GlStateManager.disableTexture2D();
		GlStateManager.disableLighting();
		// GL11.glColor4f(0.0F, 0.0F, 1.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 13
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 14
Project: Wurst-MC-1.12   File: OverlayMod.java   View Source Code Vote up 4 votes
@Override
public void onRender(float partialTicks)
{
	// check hitResult
	if(mc.objectMouseOver == null)
		return;
	
	// check position
	BlockPos pos = mc.objectMouseOver.getBlockPos();
	if(pos == null)
		return;
	
	// check if hitting block
	if(!mc.playerController.getIsHittingBlock())
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// set position
	GL11.glTranslated(pos.getX(), pos.getY(), pos.getZ());
	
	// get progress
	float progress = mc.playerController.curBlockDamageMP;
	
	// set size
	GL11.glTranslated(0.5, 0.5, 0.5);
	GL11.glScaled(progress, progress, progress);
	GL11.glTranslated(-0.5, -0.5, -0.5);
	
	// get color
	float red = progress * 2F;
	float green = 2 - red;
	
	// draw box
	GL11.glColor4f(red, green, 0, 0.25F);
	RenderUtils.drawSolidBox();
	GL11.glColor4f(red, green, 0, 0.5F);
	RenderUtils.drawOutlinedBox();
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 15
Project: KraftigAudio   File: MidiSeqTimeline.java   View Source Code Vote up 4 votes
@Override
public void render(float alpha)
{
    GL11.glPushMatrix();
    GL11.glTranslatef(pos.x, pos.y, 0.0f);
    GL11.glScalef(radius.x, radius.y, 1.0f);
    
    //Draw outline.
    GL11.glLineWidth(1.0f);
    float color = Main.instance().getFocus() == this ? 0.75f : 1.0f;
    GL11.glColor4f(color, color, 1.0f, alpha);
    GL11.glBegin(GL11.GL_LINE_LOOP);
    GL11.glVertex2f(-1.0f, -1.0f);
    GL11.glVertex2f(-1.0f, 1.0f);
    GL11.glVertex2f(1.0f, 1.0f);
    GL11.glVertex2f(1.0f, -1.0f);
    GL11.glEnd();
    
    //Enable stencil writing, disable color writing.
    GL11.glEnable(GL11.GL_STENCIL_TEST);
    GL11.glColorMask(false, false, false, false);
    GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xFF);
    GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE);

    //Draw stencil mask.
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2f(-1.0f, -1.0f);
    GL11.glVertex2f(-1.0f, 1.0f);
    GL11.glVertex2f(1.0f, 1.0f);
    GL11.glVertex2f(1.0f, -1.0f);
    GL11.glEnd();
    
    //Disable stencil writing, enable color writing.
    GL11.glColorMask(true, true, true, true);
    GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF);
    GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
    
    //Draw masked stuff here.
    
    //Return to normal stencil state.
    GL11.glDisable(GL11.GL_STENCIL_TEST);
    GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
    
    GL11.glPopMatrix();
}
 
Example 16
Project: Wurst-MC-1.12   File: BowAimbotMod.java   View Source Code Vote up 4 votes
@Override
public void onRender(float partialTicks)
{
	if(target == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// set position
	GL11.glTranslated(target.posX, target.posY, target.posZ);
	
	// set size
	double boxWidth = target.width + 0.1;
	double boxHeight = target.height + 0.1;
	GL11.glScaled(boxWidth, boxHeight, boxWidth);
	
	// move to center
	GL11.glTranslated(0, 0.5, 0);
	
	double v = 1 / velocity;
	GL11.glScaled(v, v, v);
	
	// draw outline
	GL11.glColor4d(1, 0, 0, 0.5F * velocity);
	RenderUtils.drawOutlinedBox(TARGET_BOX);
	
	// draw box
	GL11.glColor4d(1, 0, 0, 0.25F * velocity);
	RenderUtils.drawSolidBox(TARGET_BOX);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 17
Project: TFCPrimitiveTech   File: RenderSoftStone.java   View Source Code Vote up 4 votes
public void render(EntityProjectileSoftStone 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 18
Project: connor41-etfuturum2   File: OpenGLHelper.java   View Source Code Vote up 4 votes
public static void popMatrix() {
	GL11.glPopMatrix();
}
 
Example 19
Project: Halloween   File: RenderCurse.java   View Source Code Vote up 4 votes
@Override
public void doRender(EntityCurse entity, double x, double y, double z, float entityYaw, float partialTicks)
{
	GL11.glPushMatrix();
	GL11.glDisable(2884 /*GL_CULL_FACE*/);

	try
	{
		float rotation = entity.getRotation();
		float rotationYaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks;

		float ageInTicks = (float)(entity.ticksExisted + partialTicks);
		float netHeadYaw = rotationYaw - rotation;
		float headPitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
		float scale = 0.0625F;

		GL11.glTranslatef((float)x, (float)y, (float)z);

		for (int i = 0; i < 3; i++)
		{
			GL11.glPushMatrix();

			GL11.glRotatef(180.0F - rotation, 0.0F, rotation, 0.0F);
			rotation += 120.0F;

			GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
			GL11.glScalef(-1.0F, -1.0F, 1.0F);
			this.preRenderCallback(entity, partialTicks);
			GL11.glTranslatef(0.0F, -24.0F * scale - 0.0078125F, 0.0F);

			this.bindEntityTexture(entity);
			GL11.glScalef(1.01F, 1.01F, 1.01F);
			//GL11.glDisable(2896 /*GL_LIGHTING*/);
			GL11.glEnable(3042 /*GL_BLEND*/);
			GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
			GL11.glBlendFunc(1, 1);

			this.switchModel(entity);
			this.mainModel.render(entity, 0.0F, 0.0F, ageInTicks, netHeadYaw, headPitch, scale);

			GL11.glPopMatrix();
		}
		GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
		GL11.glDisable(3042 /*GL_BLEND*/);
		//GL11.glEnable(2896 /*GL_LIGHTING*/);
		GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/);
		GL11.glDisable(2884 /*GL_CULL_FACE*/);
	}
	catch (Exception exception)
	{
		exception.printStackTrace();
	}

	GL13.glClientActiveTexture(33985 /*GL_TEXTURE1_ARB*/);
	GL13.glActiveTexture(33985 /*GL_TEXTURE1_ARB*/);
	GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
	GL13.glClientActiveTexture(33984 /*GL_TEXTURE0_ARB*/);
	GL13.glActiveTexture(33984 /*GL_TEXTURE0_ARB*/);
	GL11.glEnable(2884 /*GL_CULL_FACE*/);
	GL11.glPopMatrix();
}
 
Example 20
Project: minecraft-quiverbow   File: Render_Projectile.java   View Source Code Vote up 4 votes
public void doRender_DefaultProjectile(Entity par1Entity, double x, double y, double z, float yaw, float tick, double length, double width) 
{
	GL11.glPushMatrix();
    
    this.bindEntityTexture(par1Entity);
    
    GL11.glDisable(GL11.GL_LIGHTING);			// For proper world lighting, not internal lighting. Otherwise the entity is too dark
    GL11.glDisable(GL11.GL_CULL_FACE);			// Disables the culling of back faces. Good for not having to draw front and back of a thing
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    
    GL11.glTranslatef((float)x, (float)y, (float)z);
    GL11.glScalef(0.5F, 0.5F, 0.5F);
    
    Tessellator tes = Tessellator.instance;		// Grab a instance of the tesselator here (non-static, as they say)
    
    GL11.glRotatef(par1Entity.prevRotationYaw + (par1Entity.rotationYaw - par1Entity.prevRotationYaw) * tick - 90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(par1Entity.prevRotationPitch + (par1Entity.rotationPitch - par1Entity.prevRotationPitch) * tick, 0.0F, 0.0F, 1.0F);

    float f10 = 0.05625F;
    
    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);
    
    for (int i = 0; i < 2; ++i)
    {
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glNormal3f(0.0F, 0.0F, f10);
        
        tes.startDrawingQuads();
        //			 		 X      Y     Z     TX,   TY
        tes.addVertexWithUV(-length, -width, 0.0D, 0, 0);
        tes.addVertexWithUV( length, -width, 0.0D, 0, 1);
        tes.addVertexWithUV( length,  width, 0.0D, 1, 1);
        tes.addVertexWithUV(-length,  width, 0.0D, 1, 0);
        tes.draw();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_LIGHTING);

    GL11.glPopMatrix();
}