List of usage examples for org.lwjgl.opengl GL11 glScaled
public static native void glScaled(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:com.minestellar.core.render.item.SolarGeneratorItemRender.java
License:Open Source License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED_FIRST_PERSON: GL11.glPushMatrix();//from w ww . j ava 2s . c o m GL11.glScaled(0.45D, 0.45D, 0.45D); GL11.glTranslated(0, 1, 0); TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntitySolarGenerator(), 0.0D, 0.0D, 0.0D, 0.0F); GL11.glTranslated(0, -1, 0); GL11.glPopMatrix(); break; case INVENTORY: GL11.glPushMatrix(); GL11.glScaled(0.45D, 0.45D, 0.45D); GL11.glTranslated(0, -0.75, 0); TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntitySolarGenerator(), 0.0D, 0.0D, 0.0D, 0.0F); GL11.glTranslated(0, 0.75, 0); GL11.glPopMatrix(); break; case ENTITY: GL11.glPushMatrix(); GL11.glTranslated(-0.5, 0, -0.5); TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntitySolarGenerator(), 0.0D, 0.0D, 0.0D, 0.0F); GL11.glTranslated(0.5, 0, 0.5); GL11.glPopMatrix(); default: break; } }
From source file:com.mtbs3d.minecrift.VRRenderer.java
License:LGPL
/** * Render player hand//from w w w .j a v a 2 s. c om */ private void renderHand(float par1, int renderSceneNumber) { if (this.debugViewDirection <= 0) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); if (renderSceneNumber == 0) { // Left eye FloatBuffer leftProj = eyeRenderParams.gl_getLeftProjectionMatrix(); GL11.glLoadMatrix(leftProj); //mc.checkGLError("Set left projection"); } else { // Right eye FloatBuffer rightProj = eyeRenderParams.gl_getRightProjectionMatrix(); GL11.glLoadMatrix(rightProj); //mc.checkGLError("Set right projection"); } float var3 = 0.07F; if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float) (-(renderSceneNumber * 2 - 1)) * var3, 0.0F, 0.0F); } if (this.cameraZoom != 1.0D) { GL11.glTranslatef((float) this.cameraYaw, (float) (-this.cameraPitch), 0.0F); GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); } if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { float var4 = 0.6666667F; GL11.glScalef(1.0F, var4, 1.0F); } GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix(); GL11.glLoadIdentity(); // IPD transformation if (renderSceneNumber == 0) { // Left eye FloatBuffer leftEyeTransform = eyeRenderParams.gl_getLeftViewportTransform(); GL11.glMultMatrix(leftEyeTransform); } else { // Right eye FloatBuffer rightEyeTransform = eyeRenderParams.gl_getRightViewportTransform(); GL11.glMultMatrix(rightEyeTransform); } if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float) (renderSceneNumber * 2 - 1) * 0.1F, 0.0F, 0.0F); } GL11.glPushMatrix(); this.hurtCameraEffect(par1); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(par1); } if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { this.enableLightmap((double) par1); this.itemRenderer.renderItemInFirstPerson(par1); this.disableLightmap((double) par1); } GL11.glPopMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { this.itemRenderer.renderOverlays(par1); this.hurtCameraEffect(par1); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(par1); } GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); } }
From source file:de.kitsunealex.projectx.client.render.RenderTruncatedIcosahedron.java
License:Open Source License
public void render(double size, Colour colourPent, Colour colourHex, EnumHedronTexture type) { GlStateManager.pushMatrix();/* w w w . j a v a2 s.c o m*/ GlStateManager.pushAttrib(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHT0); GL11.glDisable(GL11.GL_LIGHT1); Minecraft.getMinecraft().getTextureManager().bindTexture(type.getTexture()); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glScaled(size * 0.1D, size * 0.1D, size * 0.1D); colourPent.glColour(); GL11.glCallList(LIST_INDEX); colourHex.glColour(); GL11.glCallList(LIST_INDEX + 1); GL11.glScaled(1D / (size * 0.1D), 1D / (size * 0.1D), 1D / (size * 0.1D)); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT1); GL11.glEnable(GL11.GL_LIGHT0); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1F, 1F, 1F, 1F); GlStateManager.popAttrib(); GlStateManager.popMatrix(); }
From source file:de.sanandrew.core.manpack.mod.client.model.ModelSanPlayer.java
License:Creative Commons License
@Override public void render(Entity entity, float limbSwing, float limbSwingAmount, float rotFloat, float rotYaw, float rotPitch, float partTicks) { this.setRotationAngles(limbSwing, limbSwingAmount, rotFloat, rotYaw, rotPitch, partTicks, entity); this.quadTail1.isHidden = this.hideTails; this.quadTail2.isHidden = this.hideTails; this.quadTail3.isHidden = this.hideTails; this.quadTail4.isHidden = this.hideTails; if (!this.isArmor) { GL11.glPushMatrix();/*from w ww .ja v a 2 s. c o m*/ GL11.glTranslatef(this.head.offsetX, this.head.offsetY, this.head.offsetZ); GL11.glTranslatef(this.head.rotationPointX * partTicks, this.head.rotationPointY * partTicks, this.head.rotationPointZ * partTicks); GL11.glScaled(1.1D, 1.1D, 1.1D); GL11.glTranslatef(-this.head.offsetX, -this.head.offsetY, -this.head.offsetZ); GL11.glTranslatef(-this.head.rotationPointX * partTicks, -this.head.rotationPointY * partTicks, -this.head.rotationPointZ * partTicks); this.head.render(partTicks); GL11.glPopMatrix(); this.hair.render(partTicks); } else if (this.hatBase != null) { this.hatBase.render(partTicks); } this.bipedLeftArm.render(partTicks); this.bipedRightArm.render(partTicks); this.legLeft.render(partTicks); this.legRight.render(partTicks); this.body.render(partTicks); this.skirt1.render(partTicks); this.skirt2.render(partTicks); GL11.glPushMatrix(); GL11.glTranslatef(this.armLeft2.offsetX, this.armLeft2.offsetY, this.armLeft2.offsetZ); GL11.glTranslatef(this.armLeft2.rotationPointX * partTicks + 0.025F, this.armLeft2.rotationPointY * partTicks, this.armLeft2.rotationPointZ * partTicks); GL11.glScaled(1.05D, 1.05D, 1.05D); GL11.glTranslatef(-this.armLeft2.offsetX, -this.armLeft2.offsetY, -this.armLeft2.offsetZ); GL11.glTranslatef(-this.armLeft2.rotationPointX * partTicks - 0.025F, -this.armLeft2.rotationPointY * partTicks, -this.armLeft2.rotationPointZ * partTicks); this.armLeft2.render(partTicks); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(this.armRight2.offsetX, this.armRight2.offsetY, this.armRight2.offsetZ); GL11.glTranslatef(this.armRight2.rotationPointX * partTicks - 0.025F, this.armRight2.rotationPointY * partTicks, this.armRight2.rotationPointZ * partTicks); GL11.glScaled(1.05D, 1.05D, 1.05D); GL11.glTranslatef(-this.armRight2.offsetX, -this.armRight2.offsetY, -this.armRight2.offsetZ); GL11.glTranslatef(-this.armRight2.rotationPointX * partTicks + 0.025F, -this.armRight2.rotationPointY * partTicks, -this.armRight2.rotationPointZ * partTicks); this.armRight2.render(partTicks); GL11.glPopMatrix(); }
From source file:fr.mcnanotech.kevin_68.nanotechmod.city.client.renderer.tileentity.TileEntityTextSpotLightRender.java
License:Creative Commons License
public void renderTileEntitySignAt(TileEntityTextSpotLight tileentity, double par2, double par4, double par6, float par8) { float f = tileentity.isActiveFloat(); if (f > 0.0F) { GL11.glPushMatrix();//from w w w . j av a 2 s . com float f1 = 0.6666667F; float f2 = 0.0F; float d2 = (float) tileentity.getWorldObj().getTotalWorldTime() + par8; byte b1 = 1; double d3 = (double) d2 * 0.025D * (1.0D - (double) (b1 & 1) * 2.5D); int i1 = (tileentity.get(TileEntityTextSpotLight.REVERSEROTATION) == 1 ? -1 : 1); GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.75F * f1, (float) par6 + 0.5F); GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, -0.4F, 0.0F); GL11.glScaled(0.9D, 0.9D, 0.9D); if (tileentity.get(TileEntityTextSpotLight.ROTATE) == 0) { GL11.glRotated(d3 * 5 * tileentity.get(TileEntityTextSpotLight.ROTATIONSPEED) * i1, 0.0F, 1.0F, 0.0F); } else { GL11.glRotatef(tileentity.get(TileEntityTextSpotLight.ANGLE), 0.0F, 1.0F, 0.0F); } this.modelSign.signStick.showModel = false; this.bindTexture(field_110638_a); GL11.glPushMatrix(); GL11.glScalef(f1, -f1, -f1); this.modelSign.renderSign(); GL11.glPopMatrix(); FontRenderer fontrenderer = this.func_147498_b(); f2 = 0.016666668F * f1; GL11.glTranslatef(0.0F, 0.5F * f1, 0.07F * f1); GL11.glScalef(f2 * 5, -f2 * 5, f2 * 5); GL11.glNormal3f(0.0F, 0.0F, -1.0F * f2); GL11.glDepthMask(false); GL11.glTranslated(0.0F, -tileentity.get(TileEntityTextSpotLight.HEIGHT), 0.0F); // GL11.glTranslated(0.0F, tileentity.getScale() / 5.0F, 0.0F); GL11.glScaled(1.0 + (1.0 * (tileentity.get(TileEntityTextSpotLight.SCALE) / 10)), 1.0 + (1.0 * (tileentity.get(TileEntityTextSpotLight.SCALE) / 10)), 1.0 + (1.0 * (tileentity.get(TileEntityTextSpotLight.SCALE) / 10))); String s = tileentity.signText; fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, -20, (tileentity.get(TileEntityTextSpotLight.RED) * 65536) + (tileentity.get(TileEntityTextSpotLight.GREEN) * 256) + tileentity.get(TileEntityTextSpotLight.BLUE)); // GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); // fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, // -20, (tileentity.getRedValue() * 65536) + // (tileentity.getGreenValue() * 256) + tileentity.getBlueValue()); GL11.glDepthMask(true); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } }
From source file:fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items.ItemBlockPortableChestRender.java
License:Creative Commons License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (item.getItemDamage() == 0) { switch (type) { case EQUIPPED: { GL11.glPushMatrix();//from w w w . java 2 s .c o m Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-25F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, -0.5F, 0.0F); model.render(0.0625F); GL11.glPopMatrix(); break; } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-86.9F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.9F, -0.8F, -1.8F); GL11.glScaled(1.5F, 1.5F, 1.5F); model.render(0.0625F); GL11.glPopMatrix(); GL11.glPushMatrix(); if (((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin() != null) { player = ((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin(); } else { player = steveTextures; } Minecraft.getMinecraft().renderEngine.bindTexture(player); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-120F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(2.0F, 0.5F, 0.2F); modelB.bipedRightArm.render(0.0625F); GL11.glPopMatrix(); GL11.glPushMatrix(); if (((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin() != null) { player = ((AbstractClientPlayer) ((Entity) data[1])).getLocationSkin(); } else { player = steveTextures; } Minecraft.getMinecraft().renderEngine.bindTexture(player); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-120F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.32F, 0.5F, 0.2F); modelB.bipedLeftArm.render(0.0625F); GL11.glPopMatrix(); break; } case ENTITY: { if (RenderItem.renderInFrame) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslatef(0.2F, -1.25F, 0.0F); GL11.glScalef(1.4F, 1.4F, 1.4F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); model.render(0.0625F); GL11.glPopMatrix(); break; } } default: break; } } }
From source file:hellfirepvp.astralsorcery.client.effect.block.EffectTranslucentFallingBlock.java
License:Open Source License
@Override public void render(float pTicks) { TextureHelper.refreshTextureBindState(); TextureHelper.setActiveTextureToAtlasSprite(); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glPushMatrix();//from ww w. java 2s . co m GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glEnable(GL11.GL_BLEND); Blending.ADDITIVEDARK.apply(); if (disableDepth) { GL11.glDisable(GL11.GL_DEPTH_TEST); } GL11.glDisable(GL11.GL_CULL_FACE); RenderingUtils.removeStandartTranslationFromTESRMatrix(pTicks); Vector3 translateTo = getInterpolatedPosition(pTicks); GL11.glTranslated(translateTo.getX(), translateTo.getY(), translateTo.getZ()); float alpha = alphaFunction.getAlpha(age, maxAge); alpha *= alphaMultiplier; GL11.glColor4f(1F, 1F, 1F, alpha); float scaleF = this.scale; scaleF = scaleFunction.getScale(this, pTicks, scaleF); GL11.glTranslated(0.5, 0.5, 0.5); GL11.glScaled(scaleF, scaleF, scaleF); GL11.glTranslated(-0.5, -0.5, -0.5); Vector3 rotation = getInterpolatedRotation(pTicks); GL11.glTranslated(0.5, 0.5, 0.5); GL11.glRotated(rotation.getX(), 1, 0, 0); GL11.glRotated(rotation.getY(), 0, 1, 0); GL11.glRotated(rotation.getZ(), 0, 0, 1); GL11.glTranslated(-0.5, -0.5, -0.5); Tessellator tes = Tessellator.getInstance(); VertexBuffer vb = tes.getBuffer(); vb.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); IBlockAccess world = new AirBlockRenderWorld(Biomes.PLAINS, Minecraft.getMinecraft().world.getWorldType()); Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlock(this.blockState, BlockPos.ORIGIN, world, vb); tes.draw(); GL11.glEnable(GL11.GL_CULL_FACE); if (disableDepth) { GL11.glEnable(GL11.GL_DEPTH_TEST); } Blending.DEFAULT.apply(); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glPopMatrix(); GL11.glPopAttrib(); TextureHelper.refreshTextureBindState(); }
From source file:hellfirepvp.astralsorcery.client.event.ClientRenderEventHandler.java
License:Open Source License
@SideOnly(Side.CLIENT) private void renderAlignmentChargeOverlay(float partialTicks) { GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glPushMatrix();/*from w w w . java2 s. c o m*/ GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); Blending.DEFAULT.apply(); float height = 128F; float width = 32F; float offsetX = 0F; float offsetY = 5F; texChargeFrame.bind(); GL11.glColor4f(1F, 1F, 1F, visibilityPermCharge * 0.9F); //Draw hud itself Tessellator tes = Tessellator.getInstance(); VertexBuffer vb = tes.getBuffer(); vb.begin(7, DefaultVertexFormats.POSITION_TEX); vb.pos(offsetX, offsetY + height, 10).tex(0, 1).endVertex(); vb.pos(offsetX + width, offsetY + height, 10).tex(1, 1).endVertex(); vb.pos(offsetX + width, offsetY, 10).tex(1, 0).endVertex(); vb.pos(offsetX, offsetY, 10).tex(0, 0).endVertex(); tes.draw(); //Draw charge float filled = ConstellationPerkLevelManager.getPercToNextLevel(ResearchManager.clientProgress); height = 78F; offsetY = 27.5F + (1F - filled) * height; GL11.glColor4f(255F / 255F, 230F / 255F, 0F / 255F, visibilityPermCharge * 0.9F); texChargeCharge.bind(); height *= filled; vb.begin(7, DefaultVertexFormats.POSITION_TEX); vb.pos(offsetX, offsetY + height, 10).tex(0, 1).endVertex(); vb.pos(offsetX + width, offsetY + height, 10).tex(1, 1).endVertex(); vb.pos(offsetX + width, offsetY, 10).tex(1, 1F - filled).endVertex(); vb.pos(offsetX, offsetY, 10).tex(0, 1F - filled).endVertex(); tes.draw(); GL11.glEnable(GL11.GL_ALPHA_TEST); TextureHelper.refreshTextureBindState(); //Draw level int level = ResearchManager.clientProgress.getAlignmentLevel(); GL11.glColor4f(0.86F, 0.86F, 0.86F, visibilityPermCharge); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glPushMatrix(); GL11.glTranslated(offsetX + 13, 94, 0); GL11.glScaled(1.2, 1.2, 1.2); int c = 0x00DDDDDD; c |= ((int) (255F * visibilityPermCharge)) << 24; if (visibilityPermCharge > 0.1E-4) { Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(String.valueOf(level + 1), 0, 0, c); } GL11.glPopMatrix(); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST); TextureHelper.refreshTextureBindState(); Blending.DEFAULT.apply(); GL11.glColor4f(1F, 1F, 1F, 1F); GlStateManager.color(1F, 1F, 1F, 1F); GL11.glPopMatrix(); GL11.glPopAttrib(); }
From source file:hellfirepvp.astralsorcery.client.gui.container.GuiAltarAttunement.java
License:Open Source License
@Override public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { AbstractAltarRecipe rec = findCraftableRecipe(); if (rec != null) { ItemStack out = rec.getOutputForRender(); zLevel = 10F;// w w w. j a va 2 s . com itemRender.zLevel = 10F; RenderHelper.enableGUIStandardItemLighting(); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glPushMatrix(); GL11.glTranslated(190, 35, 0); GL11.glScaled(2.5, 2.5, 2.5); itemRender.renderItemAndEffectIntoGUI(mc.player, out, 0, 0); itemRender.renderItemOverlayIntoGUI(fontRenderer, out, 0, 0, null); GL11.glPopMatrix(); GL11.glPopAttrib(); //RenderHelper.disableStandardItemLighting(); zLevel = 0F; itemRender.zLevel = 0F; TextureHelper.refreshTextureBindState(); } }
From source file:hellfirepvp.astralsorcery.client.gui.container.GuiAltarConstellation.java
License:Open Source License
@Override public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { AbstractAltarRecipe rec = findCraftableRecipe(); if (rec != null) { ItemStack out = rec.getOutputForRender(); zLevel = 10F;/*from w w w.j a v a 2 s . c o m*/ itemRender.zLevel = 10F; RenderHelper.enableGUIStandardItemLighting(); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glPushMatrix(); GL11.glTranslated(190, 35, 0); GL11.glScaled(2.5, 2.5, 2.5); itemRender.renderItemAndEffectIntoGUI(mc.player, out, 0, 0); itemRender.renderItemOverlayIntoGUI(fontRenderer, out, 0, 0, null); GL11.glPopMatrix(); GL11.glPopAttrib(); zLevel = 0F; itemRender.zLevel = 0F; TextureHelper.refreshTextureBindState(); } }