List of usage examples for org.lwjgl.opengl GL11 glTranslated
public static native void glTranslated(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:rheel.ac.client.renderer.TileEntityRendererResearchTable.java
License:Open Source License
@Override public void renderInInventory(ItemStack item) { GL11.glPushMatrix();/* ww w.ja va2s . c o m*/ GL11.glTranslated(0, 0, 0); GL11.glRotatef(180, 1, 0, 0); ResourceLocation rl = TextureLoader.getModelTexture("ResearchTable.png"); this.bindTexture(rl); TileEntityRendererResearchTable.model.render(); GL11.glPopMatrix(); }
From source file:shadowmage.ancient_warfare.client.render.machine.RenderTEMotor.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { GL11.glPushMatrix();//from ww w . java2s . c om TEEngine engine = (TEEngine) tileentity; String tex = Config.texturePath + "models/" + engine.getTexture(); AWTextureManager.bindTexture(tex); GL11.glTranslated(d0 + 0.5d, d1 + 0.5d, d2 + 0.5d); teModel.setDirection(engine.getFacing()); teModel.setPistonPosition(engine.getPistonProgress(), f, engine.getPistonDirection()); teModel.renderEngine(); this.renderExtras(engine, f); GL11.glPopMatrix(); }
From source file:shadowmage.ancient_warfare.client.render.machine.RenderTEMotor.java
License:Open Source License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { GL11.glPushMatrix();/*from ww w .ja va 2 s . c o m*/ String tex = Config.texturePath + "models/" + EngineData.getEngineTexture(item.getItemDamage()); AWTextureManager.bindTexture(tex); GL11.glTranslated(0.5d, 0.5d, 0.5d); teModel.setDirection(ForgeDirection.UP); teModel.setPistonPosition(4.f, 0, (byte) 0); teModel.renderEngine(); GL11.glPopMatrix(); }
From source file:shadowmage.ancient_warfare.client.render.RenderCraftingHelper.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { GL11.glPushMatrix();//from ww w .j a v a2 s . co m GL11.glTranslated(d0 + 0.5d, d1, d2 + 0.5d); TEAWCrafting craft = (TEAWCrafting) tileentity; GL11.glRotatef(-90 * BlockTools.getTurnsForRender(craft.getOrientation()), 0, 1, 0); GL11.glScalef(-1, -1, 1); ModelTEBase model = RenderRegistry.instance().getTEModel(craft.getModelID()); AWTextureManager.bindTexture(RenderRegistry.instance().getTEModelTexture(craft.getModelID())); model.renderModel(craft); GL11.glPopMatrix(); }
From source file:shadowmage.ancient_warfare.client.render.RenderGateHelper.java
License:Open Source License
@Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { GL11.glPushMatrix();/*from w w w. j av a 2 s . co m*/ EntityGate gate = (EntityGate) entity; int typeNum = gate.getGateType().getGlobalID(); if (gate.hurtAnimationTicks > 0) { float percent = ((float) gate.hurtAnimationTicks / 20.f); GL11.glColor4f(1.f, 1.f - percent, 1.f - percent, 1.f); } AWTextureManager.bindTexture(((EntityGate) entity).getTexture()); GL11.glTranslated(d0, d1, d2); GL11.glRotatef(f, 0, 1, 0); GL11.glScalef(-1, -1, 1); RenderRegistry.instance().getGateRender(typeNum).doRender(entity, d0, d1, d2, f, f1); GL11.glColor4f(1.f, 1.f, 1.f, 1.f); GL11.glPopMatrix(); }
From source file:shadowmage.ancient_warfare.client.render.RenderMissileBase.java
License:Open Source License
@Override public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { GL11.glPushMatrix();//from w w w. j a va 2 s . co m MissileBase missile = (MissileBase) var1; GL11.glTranslated(var2, var4, var6); GL11.glRotatef(var8 - 90, 0, 1, 0); GL11.glRotatef(var1.rotationPitch - 90, 1, 0, 0); GL11.glScaled(-1, -1, 1); float scale = missile.ammoType.getRenderScale(); GL11.glScalef(scale, scale, scale); AWTextureManager.bindTexture(missile.getTexture()); renderMissile(missile, missile.ammoType, var2, var4, var6, var8, var9); GL11.glPopMatrix(); }
From source file:shadowmage.ancient_warfare.client.render.RenderVehicleHelper.java
License:Open Source License
@Override public void doRender(Entity var1, double x, double y, double z, float yaw, float tick) { boolean useAlpha = false; if (!Settings.renderVehiclesInFirstPerson && var1.riddenByEntity == mc.thePlayer && mc.gameSettings.thirdPersonView == 0) { useAlpha = true;// ww w .java 2 s . com GL11.glColor4f(1.f, 1.f, 1.f, 0.2f); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); } VehicleBase vehicle = (VehicleBase) var1; GL11.glPushMatrix(); GL11.glTranslated(x, y, z); GL11.glRotatef(yaw, 0, 1, 0); GL11.glScalef(-1, -1, 1); if (vehicle.hitAnimationTicks > 0) { float percent = ((float) vehicle.hitAnimationTicks / 20.f); GL11.glColor4f(1.f, 1.f - percent, 1.f - percent, 1.f); } AWTextureManager.bindTexture(vehicle.getTexture()); RenderVehicleBase render = RenderRegistry.instance() .getRenderForVehicle(vehicle.vehicleType.getGlobalVehicleType()); render.renderVehicle(vehicle, x, y, z, yaw, tick); AWRenderHelper.instance().setTeamRenderColor(vehicle.teamNum); render.renderVehicleFlag(); GL11.glColor4f(1.f, 1.f, 1.f, 1.f); GL11.glPopMatrix(); if (useAlpha) { GL11.glDisable(GL11.GL_BLEND); } /** * dont' render nameplate for the vehicle that thePlayer is on */ if (Settings.getRenderVehicleNameplates() && vehicle.riddenByEntity != mc.thePlayer) { renderNamePlate(vehicle, x, y, z, yaw, tick); } }
From source file:simElectricity.Client.Render.RenderTower.java
License:Open Source License
private void renderTower2() { GL11.glPushMatrix();//from w ww . java 2 s .co m render.render_cube(0.25, 1, 0.25); GL11.glPopMatrix(); GL11.glTranslated(0.2, 0.6, -1.5); GL11.glPushMatrix(); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.2, 3, 0.2); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); renderInsulator(4, 0.6); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 0, 3); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); renderInsulator(4, 0.6); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 0, 2); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); renderInsulator(4, 0.6); GL11.glPopMatrix(); }
From source file:simElectricity.Client.Render.RenderTower.java
License:Open Source License
private void renderTower1() { GL11.glTranslated(0, -8, 0); GL11.glPushMatrix();/* ww w . ja v a2s . c o m*/ GL11.glTranslated(0, 8, 0); render.render_cube(0.25, 2, 0.25); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 8, -1); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.1, 2.5, 0.1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 9.5, 0); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.1, 1, 0.1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 8, -1); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); renderInsulator(4, 0.6); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 8, 1.5); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); renderInsulator(4, 0.6); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 9.5, 1); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); renderInsulator(4, 0.6); GL11.glPopMatrix(); }
From source file:simElectricity.Client.Render.RenderTower.java
License:Open Source License
private void renderTower0() { //1//w w w .j a va 2s .c o m GL11.glPushMatrix(); GL11.glTranslated(-2.455, -9.85, -2.385); GL11.glRotatef(-90F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-2.385, -9.85, -2.455); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); //2 GL11.glPushMatrix(); GL11.glTranslated(2.455, -9.85, 2.385); GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(2.385, -9.85, 2.455); GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); //3 GL11.glPushMatrix(); GL11.glTranslated(2.455, -9.85, -2.385); GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(2.385, -9.85, -2.455); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); //4 GL11.glPushMatrix(); GL11.glTranslated(-2.455, -9.85, 2.385); GL11.glRotatef(-90F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-2.385, -9.85, 2.455); GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 0.5, 0.15); GL11.glPopMatrix(); //1 GL11.glPushMatrix(); GL11.glTranslated(-2.4, -9.85, -2.385); GL11.glRotatef(-24F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(7.8F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-2.385, -9.85, -2.4); GL11.glRotatef(24F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-7.8F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); //2 GL11.glPushMatrix(); GL11.glTranslated(2.4, -9.85, 2.385); GL11.glRotatef(24F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-7.8F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(2.385, -9.85, 2.4); GL11.glRotatef(-24F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(7.8F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); //3 GL11.glPushMatrix(); GL11.glTranslated(2.4, -9.85, -2.385); GL11.glRotatef(24F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(7.8F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(2.385, -9.85, -2.4); GL11.glRotatef(24F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(7.8F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); //4 GL11.glPushMatrix(); GL11.glTranslated(-2.4, -9.85, 2.385); GL11.glRotatef(-24F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-7.8F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-2.385, -9.85, 2.4); GL11.glRotatef(-24F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-7.8F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 8.8, 0.15); GL11.glPopMatrix(); //1 GL11.glPushMatrix(); GL11.glTranslated(-1.18, -1.8, -1.18); GL11.glRotatef(-38F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(7F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-1.18, -1.8, -1.18); GL11.glRotatef(38F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-7F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); //2 GL11.glPushMatrix(); GL11.glTranslated(-1.18, -1.8, 1.18); GL11.glRotatef(-38F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-7F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-1.18, -1.8, 1.18); GL11.glRotatef(-38F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-7F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); //3 GL11.glPushMatrix(); GL11.glTranslated(1.18, -1.8, 1.18); GL11.glRotatef(38F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-7F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(1.18, -1.8, 1.18); GL11.glRotatef(-38F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(7F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); //4 GL11.glPushMatrix(); GL11.glTranslated(1.18, -1.8, -1.18); GL11.glRotatef(38F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(7F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(1.18, -1.8, -1.18); GL11.glRotatef(38F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(7F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 3.3, 0.15); GL11.glPopMatrix(); GL11.glTranslated(0, -6, 0); //Base1 GL11.glPushMatrix(); GL11.glTranslated(2.4, -3.9, -2.4); GL11.glRotatef(8.5F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(8.5F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 10.9, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-2.4, -3.9, 2.4); GL11.glRotatef(351.5F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(351.5F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 10.9, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(2.4, -3.9, 2.4); GL11.glRotatef(351.5F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(8.5F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 10.9, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-2.4, -3.9, -2.4); GL11.glRotatef(8.5F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(351.5F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 10.9, 0.15); GL11.glPopMatrix(); //Base2 (H) GL11.glPushMatrix(); GL11.glTranslated(-0.8, 6.7, -0.9); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 1.8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.8, 6.7, -0.9); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 1.8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.85, 6.7, -0.8); GL11.glRotatef(90, 1.0F, 0.0F, 0.0F); GL11.glRotatef(90, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 1.7, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.85, 6.7, 0.8); GL11.glRotatef(90, 1.0F, 0.0F, 0.0F); GL11.glRotatef(90, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 1.7, 0.15); GL11.glPopMatrix(); //Base3 GL11.glPushMatrix(); GL11.glTranslated(-0.8, 6.7, -0.8); GL11.glRotatef(340F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(355F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.8, 6.7, -0.8); GL11.glRotatef(340F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(5F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.8, 6.7, 0.8); GL11.glRotatef(20F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(5F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 5, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-0.8, 6.7, 0.8); GL11.glRotatef(20F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(355F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 5, 0.15); GL11.glPopMatrix(); //Horizontal1 GL11.glPushMatrix(); GL11.glTranslated(-0.45, 10, -4); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 8, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.45, 10, -4); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); render.render_cube(0.15, 8, 0.15); GL11.glPopMatrix(); //Insulators GL11.glPushMatrix(); GL11.glTranslated(0, 9, 0); renderInsulator(8, 1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 9, -3); renderInsulator(8, 1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 9, 3); renderInsulator(8, 1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.45, 10, 2); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(167F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 4.2, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.45, 10, -2); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(13F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 4.2, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.5, 10, 2); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(26F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 2.2, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-0.5, 10, 2); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-26F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 2.2, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0.45, 10, -3.9); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(26F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 2, 0.15); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(-0.45, 10, -3.9); GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-26F, 0.0F, 0.0F, 1.0F); render.render_cube(0.15, 2, 0.15); GL11.glPopMatrix(); }