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:com.shinoow.abyssalcraft.client.model.entity.ModelChagaroth.java
License:Apache License
@Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { GL11.glPushMatrix();//from w w w. j a va2 s. c o m super.render(entity, f, f1, f2, f3, f4, f5); GL11.glScalef(2.0F, 2.0F, 2.0F); GL11.glTranslatef(0F, -0.75F, 0F); setRotationAngles(f, f1, f2, f3, f4, f5, entity); frontspike1.render(f5); frontspike2.render(f5); frontspike3.render(f5); frontspike4.render(f5); frontspike5.render(f5); leftneck.render(f5); middleneck.render(f5); rightneck.render(f5); body.render(f5); tentacle2base.render(f5); tentacle1.render(f5); tentacle2.render(f5); tentacle3.render(f5); tentacle4.render(f5); tentacle5.render(f5); tentacle6.render(f5); tentacle7.render(f5); tentacle8.render(f5); tentacle9.render(f5); tentacle10.render(f5); tentacle11.render(f5); tentacle12.render(f5); tentacle13.render(f5); tentacle14.render(f5); tentacle15.render(f5); tentacle16.render(f5); tentacle17.render(f5); tentacle18.render(f5); tentacle19.render(f5); tentacle20.render(f5); tlib12.render(f5); tlib22.render(f5); tspike12.render(f5); tspike22.render(f5); tspike32.render(f5); tspike42.render(f5); tlib1.render(f5); tlib2.render(f5); tspike1.render(f5); tspike2.render(f5); tspike3.render(f5); tspike4.render(f5); lefthead.render(f5); middlehead.render(f5); righthead.render(f5); middlewall.render(f5); rightwall.render(f5); leftwall.render(f5); walltentacle1.render(f5); walltentacle2.render(f5); walltentacle3.render(f5); walltentacle4.render(f5); walltentacle5.render(f5); walltentacle6.render(f5); walltentacle7.render(f5); walltentacle8.render(f5); GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDG.java
License:Apache License
@Override public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { super.render(par1Entity, par2, par3, par4, par5, par6, par7); setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); if (isChild) { float f6 = 2.0F; GL11.glPushMatrix();// w w w . j a va 2s. com GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6); GL11.glTranslatef(0.0F, 21.0F * par7, 0.0F); Head.render(par7); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); Spine1.render(par7); Spine2.render(par7); lrib1.render(par7); lrib2.render(par7); lrib3.render(par7); rrib1.render(par7); rrib2.render(par7); rrib3.render(par7); pelvis.render(par7); Spine3.render(par7); larm1.render(par7); rarm1.render(par7); lleg.render(par7); rleg.render(par7); back.render(par7); lside.render(par7); rside.render(par7); GL11.glPopMatrix(); } else { Head.render(par7); Spine1.render(par7); Spine2.render(par7); lrib1.render(par7); lrib2.render(par7); lrib3.render(par7); rrib1.render(par7); rrib2.render(par7); rrib3.render(par7); pelvis.render(par7); Spine3.render(par7); larm1.render(par7); rarm1.render(par7); lleg.render(par7); rleg.render(par7); back.render(par7); lside.render(par7); rside.render(par7); } }
From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDragonBoss.java
License:Apache License
@Override public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { GL11.glPushMatrix();//www .j a va2 s . co m EntityDragonBoss entitydragon = (EntityDragonBoss) par1Entity; float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * partialTicks; jaw.rotateAngleX = (float) (Math.sin(f6 * (float) Math.PI * 2.0F) + 1.0D) * 0.2F; float f7 = (float) (Math.sin(f6 * (float) Math.PI * 2.0F - 1.0F) + 1.0D); f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F; GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F); GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F); float f8 = -30.0F; float f9 = 0.0F; float f10 = 1.5F; double[] adouble = entitydragon.getMovementOffsets(6, partialTicks); float f11 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] - entitydragon.getMovementOffsets(10, partialTicks)[0]); float f12 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] + f11 / 2.0F); f8 += 2.0F; float f13 = f6 * (float) Math.PI * 2.0F; f8 = 20.0F; float f14 = -12.0F; float f15; for (int i = 0; i < 5; ++i) { double[] adouble1 = entitydragon.getMovementOffsets(5 - i, partialTicks); f15 = (float) Math.cos(i * 0.45F + f13) * 0.15F; neck.rotateAngleY = updateRotations(adouble1[0] - adouble[0]) * (float) Math.PI / 180.0F * f10; neck.rotateAngleX = f15 + (float) (adouble1[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F; neck.rotateAngleZ = -updateRotations(adouble1[0] - f12) * (float) Math.PI / 180.0F * f10; neck.rotationPointY = f8; neck.rotationPointZ = f14; neck.rotationPointX = f9; f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D); f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); neck.render(par7); } head.rotationPointY = f8; head.rotationPointZ = f14; head.rotationPointX = f9; double[] adouble2 = entitydragon.getMovementOffsets(0, partialTicks); head.rotateAngleY = updateRotations(adouble2[0] - adouble[0]) * (float) Math.PI / 180.0F * 1.0F; head.rotateAngleZ = -updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * 1.0F; head.render(par7); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 1.0F, 0.0F); GL11.glRotatef(-f11 * f10 * 1.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -1.0F, 0.0F); body.rotateAngleZ = 0.0F; body.render(par7); for (int j = 0; j < 2; ++j) { GL11.glEnable(GL11.GL_CULL_FACE); f15 = f6 * (float) Math.PI * 2.0F; wing.rotateAngleX = 0.125F - (float) Math.cos(f15) * 0.2F; wing.rotateAngleY = 0.25F; wing.rotateAngleZ = (float) (Math.sin(f15) + 0.125D) * 0.8F; wingTip.rotateAngleZ = -((float) (Math.sin(f15 + 2.0F) + 0.5D)) * 0.75F; rearLeg.rotateAngleX = 1.0F + f7 * 0.1F; rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F; rearFoot.rotateAngleX = 0.75F + f7 * 0.1F; frontLeg.rotateAngleX = 1.3F + f7 * 0.1F; frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F; frontFoot.rotateAngleX = 0.75F + f7 * 0.1F; wing.render(par7); frontLeg.render(par7); rearLeg.render(par7); GL11.glScalef(-1.0F, 1.0F, 1.0F); if (j == 0) GL11.glCullFace(GL11.GL_FRONT); } GL11.glPopMatrix(); GL11.glCullFace(GL11.GL_BACK); GL11.glDisable(GL11.GL_CULL_FACE); float f16 = -((float) Math.sin(f6 * (float) Math.PI * 2.0F)) * 0.0F; f13 = f6 * (float) Math.PI * 2.0F; f8 = 10.0F; f14 = 60.0F; f9 = 0.0F; adouble = entitydragon.getMovementOffsets(11, partialTicks); for (int k = 0; k < 12; ++k) { adouble2 = entitydragon.getMovementOffsets(12 + k, partialTicks); f16 = (float) (f16 + Math.sin(k * 0.45F + f13) * 0.05000000074505806D); neck.rotateAngleY = (updateRotations(adouble2[0] - adouble[0]) * f10 + 180.0F) * (float) Math.PI / 180.0F; neck.rotateAngleX = f16 + (float) (adouble2[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F; neck.rotateAngleZ = updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * f10; neck.rotationPointY = f8; neck.rotationPointZ = f14; neck.rotationPointX = f9; f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D); f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); neck.render(par7); } GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.model.entity.ModelDragonMinion.java
License:Apache License
@Override public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { GL11.glPushMatrix();//from ww w . j a va 2 s. com EntityDragonMinion entitydragon = (EntityDragonMinion) par1Entity; float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * partialTicks; jaw.rotateAngleX = (float) (Math.sin(f6 * (float) Math.PI * 2.0F) + 1.0D) * 0.2F; float f7 = (float) (Math.sin(f6 * (float) Math.PI * 2.0F - 1.0F) + 1.0D); f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F; GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F); GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F); float f8 = -30.0F; float f9 = 0.0F; float f10 = 1.5F; double[] adouble = entitydragon.getMovementOffsets(6, partialTicks); float f11 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] - entitydragon.getMovementOffsets(10, partialTicks)[0]); float f12 = updateRotations(entitydragon.getMovementOffsets(5, partialTicks)[0] + f11 / 2.0F); f8 += 2.0F; float f13 = f6 * (float) Math.PI * 2.0F; f8 = 20.0F; float f14 = -12.0F; float f15; for (int i = 0; i < 5; ++i) { double[] adouble1 = entitydragon.getMovementOffsets(5 - i, partialTicks); f15 = (float) Math.cos(i * 0.45F + f13) * 0.15F; neck.rotateAngleY = updateRotations(adouble1[0] - adouble[0]) * (float) Math.PI / 180.0F * f10; neck.rotateAngleX = f15 + (float) (adouble1[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F; neck.rotateAngleZ = -updateRotations(adouble1[0] - f12) * (float) Math.PI / 180.0F * f10; neck.rotationPointY = f8; neck.rotationPointZ = f14; neck.rotationPointX = f9; f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D); f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); neck.render(par7); } head.rotationPointY = f8; head.rotationPointZ = f14; head.rotationPointX = f9; double[] adouble2 = entitydragon.getMovementOffsets(0, partialTicks); head.rotateAngleY = updateRotations(adouble2[0] - adouble[0]) * (float) Math.PI / 180.0F * 1.0F; head.rotateAngleZ = -updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * 1.0F; head.render(par7); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 1.0F, 0.0F); GL11.glRotatef(-f11 * f10 * 1.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -1.0F, 0.0F); body.rotateAngleZ = 0.0F; body.render(par7); for (int j = 0; j < 2; ++j) { GL11.glEnable(GL11.GL_CULL_FACE); f15 = f6 * (float) Math.PI * 2.0F; wing.rotateAngleX = 0.125F - (float) Math.cos(f15) * 0.2F; wing.rotateAngleY = 0.25F; wing.rotateAngleZ = (float) (Math.sin(f15) + 0.125D) * 0.8F; wingTip.rotateAngleZ = -((float) (Math.sin(f15 + 2.0F) + 0.5D)) * 0.75F; rearLeg.rotateAngleX = 1.0F + f7 * 0.1F; rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F; rearFoot.rotateAngleX = 0.75F + f7 * 0.1F; frontLeg.rotateAngleX = 1.3F + f7 * 0.1F; frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F; frontFoot.rotateAngleX = 0.75F + f7 * 0.1F; wing.render(par7); frontLeg.render(par7); rearLeg.render(par7); GL11.glScalef(-1.0F, 1.0F, 1.0F); if (j == 0) GL11.glCullFace(GL11.GL_FRONT); } GL11.glPopMatrix(); GL11.glCullFace(GL11.GL_BACK); GL11.glDisable(GL11.GL_CULL_FACE); float f16 = -((float) Math.sin(f6 * (float) Math.PI * 2.0F)) * 0.0F; f13 = f6 * (float) Math.PI * 2.0F; f8 = 10.0F; f14 = 60.0F; f9 = 0.0F; adouble = entitydragon.getMovementOffsets(11, partialTicks); for (int k = 0; k < 12; ++k) { adouble2 = entitydragon.getMovementOffsets(12 + k, partialTicks); f16 = (float) (f16 + Math.sin(k * 0.45F + f13) * 0.05000000074505806D); neck.rotateAngleY = (updateRotations(adouble2[0] - adouble[0]) * f10 + 180.0F) * (float) Math.PI / 180.0F; neck.rotateAngleX = f16 + (float) (adouble2[1] - adouble[1]) * (float) Math.PI / 180.0F * f10 * 5.0F; neck.rotateAngleZ = updateRotations(adouble2[0] - f12) * (float) Math.PI / 180.0F * f10; neck.rotationPointY = f8; neck.rotationPointZ = f14; neck.rotationPointX = f9; f8 = (float) (f8 + Math.sin(neck.rotateAngleX) * 10.0D); f14 = (float) (f14 - Math.cos(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); f9 = (float) (f9 - Math.sin(neck.rotateAngleY) * Math.cos(neck.rotateAngleX) * 10.0D); neck.render(par7); } GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.RenderODB.java
License:Apache License
public void doRender(EntityODBPrimed par1EntityODBPrimed, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix();// w w w . ja v a 2 s . c o m GL11.glTranslatef((float) par2, (float) par4, (float) par6); float var10; if (par1EntityODBPrimed.fuse - par9 + 1.0F < 10.0F) { var10 = 1.0F - (par1EntityODBPrimed.fuse - par9 + 1.0F) / 10.0F; if (var10 < 0.0F) var10 = 0.0F; if (var10 > 1.0F) var10 = 1.0F; var10 *= var10; var10 *= var10; float var11 = 1.0F + var10 * 0.3F; GL11.glScalef(var11, var11, var11); } var10 = (1.0F - (par1EntityODBPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; bindEntityTexture(par1EntityODBPrimed); blockRenderer.renderBlockAsItem(AbyssalCraft.ODB, 0, par1EntityODBPrimed.getBrightness(par9)); if (par1EntityODBPrimed.fuse / 5 % 2 == 0) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); blockRenderer.renderBlockAsItem(AbyssalCraft.ODB, 0, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); } GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.RenderODBc.java
License:Apache License
public void doRender(EntityODBcPrimed par1EntityODBcPrimed, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix();//from ww w. j a va 2s .c om GL11.glTranslatef((float) par2, (float) par4, (float) par6); float var10; if (par1EntityODBcPrimed.fuse - par9 + 1.0F < 10.0F) { var10 = 1.0F - (par1EntityODBcPrimed.fuse - par9 + 1.0F) / 10.0F; if (var10 < 0.0F) var10 = 0.0F; if (var10 > 1.0F) var10 = 1.0F; var10 *= var10; var10 *= var10; float var11 = 1.0F + var10 * 0.3F; GL11.glScalef(var11, var11, var11); } var10 = (1.0F - (par1EntityODBcPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; bindEntityTexture(par1EntityODBcPrimed); blockRenderer.renderBlockAsItem(AbyssalCraft.ODBcore, 0, par1EntityODBcPrimed.getBrightness(par9)); if (par1EntityODBcPrimed.fuse / 5 % 2 == 0) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); blockRenderer.renderBlockAsItem(AbyssalCraft.ODBcore, 0, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); } GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.TileEntityAltarRenderer.java
License:Apache License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix();// w ww. j av a 2 s.c om GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); Minecraft.getMinecraft().renderEngine.bindTexture(Resourcelocation); model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.TileEntityDGheadRenderer.java
License:Apache License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix();/*from w w w .java 2 s. c om*/ GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); TileEntityDGhead tile = (TileEntityDGhead) te; int direction = tile.getDirection(); GL11.glRotatef(direction * 90, 0.0F, 1.0F, 0.0F); model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.TileEntityDreadAltarBottomRenderer.java
License:Apache License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix();/* www. ja va 2 s. co m*/ GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.TileEntityOheadRenderer.java
License:Apache License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix();/*from www .ja va 2 s. c om*/ GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); TileEntityOhead tile = (TileEntityOhead) te; int direction = tile.getDirection(); GL11.glRotatef(direction * 90, 0.0F, 1.0F, 0.0F); model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }