List of usage examples for org.lwjgl.opengl GL11 glTranslatef
public static native void glTranslatef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);
From source file:cn.lambdalib.util.client.RenderUtils.java
License:MIT License
public static void renderOverlayInv(ResourceLocation src) { GL11.glDepthFunc(GL11.GL_EQUAL);//from www . j av a 2 s. co m GL11.glDisable(GL11.GL_LIGHTING); loadTexture(src); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f7 = 0.76F; //GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); float f8 = 0.125F; GL11.glScalef(f8, f8, f8); float f9 = GameTimer.getAbsTime() % 3000L / 3000.0F * 8.0F; GL11.glTranslatef(f9, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); t.startDrawingQuads(); t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); t.addVertexWithUV(0.0, 16.0, 0.0, 0.0, 1.0); t.addVertexWithUV(16.0, 16.0, 0.0, 1.0, 1.0); t.addVertexWithUV(16.0, 0.0, 0.0, 1.0, 0.0); t.draw(); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(f8, f8, f8); f9 = GameTimer.getAbsTime() % 4873L / 4873.0F * 8.0F; GL11.glTranslatef(-f9, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); t.startDrawingQuads(); t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); t.addVertexWithUV(0.0, 16.0, 0.0, 0.0, 1.0); t.addVertexWithUV(16.0, 16.0, 0.0, 1.0, 1.0); t.addVertexWithUV(16.0, 0.0, 0.0, 1.0, 0.0); t.draw(); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); }
From source file:cn.liutils.api.client.render.RenderIcon.java
License:Open Source License
@Override public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { GL11.glEnable(GL11.GL_BLEND);/*w ww .j a v a 2s . co m*/ GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL11.GL_CULL_FACE); if (!enableDepth) GL11.glDisable(GL11.GL_DEPTH_TEST); if (!hasLight) GL11.glDisable(GL11.GL_LIGHTING); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); { GL11.glTranslatef((float) par2, (float) par4, (float) par6); GL11.glScalef(size, size, size); if (this.viewOptimize) { boolean firstPerson = Minecraft.getMinecraft().gameSettings.thirdPersonView == 0; if (firstPerson) { GL11.glTranslated(fpOffsetX, fpOffsetY, fpOffsetZ); } else { GL11.glTranslated(tpOffsetX, tpOffsetY, tpOffsetZ); } } if (icon != null) RenderUtils.loadTexture(icon); Tessellator t = Tessellator.instance; this.func_77026_a(t); } GL11.glPopMatrix(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_CULL_FACE); }
From source file:cn.liutils.core.client.render.RenderPlayerHook.java
License:Open Source License
private void traverse(EntityPlayerHook ent, Set<IPlayerRenderHook> hooks) { for (IPlayerRenderHook hook : hooks) { GL11.glPushMatrix();/* ww w .java 2 s .com*/ GL11.glRotatef(ent.rotationYaw, 0.0F, -1.0F, 0.0F); GL11.glPushMatrix(); { GL11.glTranslated(0, -1.67, 0); hook.renderBody(ent.player, ent.worldObj); } GL11.glPopMatrix(); GL11.glTranslatef(0.0F, 0.5F, 0.0F); hook.renderHead(ent.player, ent.worldObj); GL11.glPopMatrix(); } }
From source file:cn.liutils.template.client.render.entity.RenderModel.java
License:Open Source License
@Override public void doRender(Entity entity, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix();/* w ww . j a v a 2s .com*/ { bindTexture(texture); GL11.glTranslatef((float) par2, (float) par4 + 2 * entity.height, (float) par6); GL11.glTranslatef(offsetX, offsetY, offsetZ); GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F * modelScale); } GL11.glPopMatrix(); }
From source file:cn.liutils.template.client.render.entity.RenderModelProjectile.java
License:Open Source License
@Override public void doRender(Entity ent, double par2, double par4, double par6, float par8, float par9) { Motion3D motion = new Motion3D(ent); GL11.glPushMatrix();//from w ww. j av a 2s . co m { bindTexture(TEXTURE_PATH); GL11.glTranslatef((float) par2, (float) par4, (float) par6); GL11.glRotatef(180.0F - ent.rotationYaw, 0.0F, -1.0F, 0.0F); // ? GL11.glRotatef(ent.rotationPitch, 1.0F, 0.0F, 0.0F); // GL11.glScalef(-1.0F, -1.0F, 1.0F); model.render(ent, (float) par2, (float) par4, (float) par6, par8, par9, 0.0625F); } GL11.glPopMatrix(); }
From source file:cn.liutils.util.RenderUtils.java
License:Open Source License
public static void renderOverlay_Equip(ResourceLocation src) { //Setup//from w ww . j a va 2 s . com GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); loadTexture(src); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f7 = 0.76F; GL11.glMatrixMode(GL11.GL_TEXTURE); //Push texture mat GL11.glPushMatrix(); float f8 = 0.125F; GL11.glScalef(f8, f8, f8); float f9 = Minecraft.getSystemTime() % 3000L / 3000.0F * 8.0F; GL11.glTranslatef(f9, 0.0F, 0.0F); //xOffset loops between 0.0 and 8.0 GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); ItemRenderer.renderItemIn2D(t, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); GL11.glPopMatrix(); //Second pass GL11.glPushMatrix(); GL11.glScalef(f8, f8, f8); f9 = Minecraft.getSystemTime() % 4873L / 4873.0F * 8.0F; //Loop between 0 and 8, longer loop GL11.glTranslatef(-f9, 0.0F, 0.0F); //Still xOffset GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); //However, different rotation! ItemRenderer.renderItemIn2D(t, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); GL11.glPopMatrix(); //Pop texture mat GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); }
From source file:cn.liutils.util.RenderUtils.java
License:Open Source License
public static void renderOverlay_Inv(ResourceLocation src) { GL11.glDepthFunc(GL11.GL_EQUAL);/*from w w w .j a va2 s. c o m*/ GL11.glDisable(GL11.GL_LIGHTING); loadTexture(src); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f7 = 0.76F; //GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); float f8 = 0.125F; GL11.glScalef(f8, f8, f8); float f9 = Minecraft.getSystemTime() % 3000L / 3000.0F * 8.0F; GL11.glTranslatef(f9, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); t.startDrawingQuads(); t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); t.addVertexWithUV(0.0, 16.0, 0.0, 0.0, 1.0); t.addVertexWithUV(16.0, 16.0, 0.0, 1.0, 1.0); t.addVertexWithUV(16.0, 0.0, 0.0, 1.0, 0.0); t.draw(); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(f8, f8, f8); f9 = Minecraft.getSystemTime() % 4873L / 4873.0F * 8.0F; GL11.glTranslatef(-f9, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); t.startDrawingQuads(); t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); t.addVertexWithUV(0.0, 16.0, 0.0, 0.0, 1.0); t.addVertexWithUV(16.0, 16.0, 0.0, 1.0, 1.0); t.addVertexWithUV(16.0, 0.0, 0.0, 1.0, 0.0); t.draw(); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); }
From source file:cn.weaponmod.api.client.render.RenderDualWieldWeapon.java
License:Open Source License
@Override public void renderEquipped(ItemStack item, RenderBlocks render, EntityLivingBase entity, ItemRenderType type) { GL11.glPushMatrix();//from w w w . j a v a 2 s . c o m super.doRenderEquipped(item, render, entity, false, type); boolean firstPerson = (entity == Minecraft.getMinecraft().thePlayer && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0) && Minecraft.getMinecraft().currentScreen == null; GL11.glTranslatef(0.0F, 0.0F, firstPerson ? -1.7F : 0.8F); GL11.glScalef(1.0F, 1.0F, -1.0F); GL11.glDisable(GL11.GL_CULL_FACE); super.doRenderEquipped(item, render, entity, true, type); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPopMatrix(); }
From source file:cn.weaponmod.api.client.render.RenderDualWieldWeapon.java
License:Open Source License
@Override public void renderInventory() { GL11.glPushMatrix();/*from ww w . j a v a2 s. co m*/ GL11.glTranslatef(-1.5F, -3F, -6.0F); super.renderInventory(); GL11.glTranslatef(3.0F, 3.0F, 6.0F); GL11.glRotatef(20, 0.0F, 1.0F, 0.0F); super.renderInventory(); GL11.glPopMatrix(); }
From source file:com.aelitis.azureus.plugins.view3d.ViewTest2.java
License:Open Source License
static void drawCylinder(float R, float H, int completion, int color) { float height = H * completion / 100; Disk disk = new Disk(); disk.draw(0.0f, R, 16, 1);// w ww .j a va 2 s .c om Cylinder cylinder = new Cylinder(); cylinder.draw(R, R, height, 16, 1); GL11.glTranslatef(0, 0, height); disk = new Disk(); disk.draw(0.0f, R, 16, 1); cylinder = new Cylinder(); cylinder.draw(R, R, H - height, 16, 1); GL11.glTranslatef(0, 0, H - height); }