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:pixlepix.auracascade.lexicon.page.PageImage.java
License:Creative Commons License
@Override @SideOnly(Side.CLIENT)// ww w . java 2s .c o m public void renderScreen(IGuiLexiconEntry gui, int mx, int my) { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(resource); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(gui.getLeft() + gui.getWidth() / 8, gui.getTop() + gui.getHeight() / 8, 0); GL11.glScaled(.5, .5, .5); ((GuiScreen) gui).drawTexturedModalRect(0, 0, 0, 0, (int) (gui.getWidth() * 1.5) + 5, (int) (gui.getHeight() * 1.5) - 15); GL11.glDisable(GL11.GL_BLEND); int width = gui.getWidth() - 30; int height = gui.getHeight(); int x = gui.getLeft() + 16; int y = gui.getTop() + height - 40; //PageText.renderText(x, y, width, height, getUnlocalizedName()); }
From source file:rainwarrior.mt100.client.TileEntityMT100Renderer.java
License:Open Source License
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTick) { TileEntityMT100 te = (TileEntityMT100) tile; if (te == null) return;// w ww . j av a2 s . c o m GL11.glColor4f(0F, 0F, 0F, 0F); GL11.glPushMatrix(); GL11.glTranslated(x, y, z); GL11.glScaled(-1D / 16D, -1D / 16D, -1D / 16D); GL11.glTranslatef(-15, -14, 0); if (te.backlight) { OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(0F, 0F, 0F, 0F); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); } RenderHelper.disableStandardItemLighting(); te.screen.render(14, 12); if (te.backlight) { OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glEnable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); } GL11.glTranslatef(7, 6, -8); Tessellator tes = Tessellator.instance; GL11.glDisable(GL11.GL_TEXTURE_2D); tes.startDrawingQuads(); tes.setColorRGBA(0xB4, 0x8E, 0x4F, 0xFF); int w1 = 6; int w2 = 3; addSquareZ(tes, -7, 8, 8, 6, 8); addSquareZ(tes, 7, 8, 6, -8, 8); addSquareZ(tes, -8, 7, -6, -8, 8); addSquareZ(tes, -8, -7, 8, -6, 8); addSquareZ(tes, -w1, 8, w1, 8, w2); addSquareZ(tes, w1, 8, -8, w1, w2); addSquareZ(tes, -8, w1, -8, -w1, w2); addSquareZ(tes, -8, -w1, -w1, 8, w2); addSquareZ(tes, -w1, w1, -w1, w1, -8); addSquareX(tes, -8, -8, 8, w2, 8); addSquareX(tes, 8, 8, -8, w2, 8); addSquareY(tes, -8, 8, -8, w2, 8); addSquareY(tes, 8, -8, 8, w2, 8); addSquareX(tes, -w1, -w1, w1, -8, w2); addSquareX(tes, w1, w1, -w1, -8, w2); addSquareY(tes, -w1, w1, -w1, -8, w2); addSquareY(tes, w1, -w1, w1, -8, w2); tes.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); RenderHelper.enableStandardItemLighting(); GL11.glPopMatrix(); }
From source file:reborncore.client.multiblock.MultiblockRenderEvent.java
License:Open Source License
private boolean renderComponent(World world, Multiblock mb, MultiblockComponent comp, int anchorX, int anchorY, int anchorZ) { ChunkCoordinates pos = comp.getRelativePosition(); int x = pos.posX + anchorX; int y = pos.posY + anchorY; int z = pos.posZ + anchorZ; if (world.getBlock(x, y, z) == comp.getBlock() && world.getBlockMetadata(x, y, z) == comp.getMeta()) return false; GL11.glPushMatrix();/*from w ww.j ava2s . c o m*/ GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glColor4f(1F, 1F, 1F, 0.4F); GL11.glTranslated(x + 0.5 - RenderManager.renderPosX, y + 0.5 - RenderManager.renderPosY, z + 0.5 - RenderManager.renderPosZ); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); blockRender.useInventoryTint = false; Block block = comp.getBlock(); if (IMultiblockRenderHook.renderHooks.containsKey(block)) IMultiblockRenderHook.renderHooks.get(block).renderBlockForMultiblock(world, mb, block, comp.getMeta(), blockRender); else blockRender.renderBlockAsItem(comp.getBlock(), comp.getMeta(), 1F); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); return true; }
From source file:RediscoveredMod.MD3Renderer.java
License:Open Source License
public void renderTag(String tagName, MD3Renderer renderer, int var1, int var2, float var3, int var4, int var5, float var6) { MD3Tag tag = (MD3Tag) this.model.tags.get(tagName); if (tag == null) { System.out.println(tagName + ": no such tag!"); return;//from ww w. j a v a2 s.c om } double x = tag.coords[var1].xCoord + (tag.coords[var2].xCoord - tag.coords[var1].xCoord) * var3; double y = tag.coords[var1].yCoord + (tag.coords[var2].yCoord - tag.coords[var1].yCoord) * var3; double z = tag.coords[var1].zCoord + (tag.coords[var2].zCoord - tag.coords[var1].zCoord) * var3; GL11.glTranslated(x, y, z); renderer.render(var4, var5, var6); }
From source file:RediscoveredMod.ModelDragonEggRed.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();/* w w w . j a v a 2s.c o m*/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); Bulk.render(scale); Bulk2.render(scale); Bulk3.render(scale); Bulk4.render(scale); Bulk5.render(scale); Bulk6.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:RediscoveredMod.ModelLectern.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();//w ww . j a v a 2 s. c o m GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); Base.render(scale); Gold.render(scale); Post.render(scale); StandBase.render(scale); Stand.render(scale); BackStand.render(scale); StandSide.render(scale); BookCover.render(scale); BookBack.render(scale); BookSide.render(scale); BookPages.render(scale); }
From source file:RediscoveredMod.ModelLecternOpen.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();/* w ww .j av a2 s . co m*/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); Base.render(scale); Gold.render(scale); Post.render(scale); StandBase.render(scale); Stand.render(scale); BackStand.render(scale); StandSide.render(scale); BookSide.render(scale); BookFront.render(scale); BookBack.render(scale); BookPagesLeft.render(scale); BookPagesRight.render(scale); BookPage1.render(scale); BookPage2.render(scale); }
From source file:RediscoveredMod.ModelStairs.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();/* w w w .jav a2 s .c o m*/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); seat.render(scale); back.render(scale); }
From source file:render.Render.java
License:Open Source License
public void StartRender() { if (flag)/*from w ww. j a v a 2s . c o m*/ this.resetGL(); flag = false; GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor3d(0.0F, 0.0F, 0.0F); GL11.glPushMatrix(); GL11.glScaled(Normal.toPlan(1), Normal.toPlan(1), 1); GL11.glTranslated(Normal.rx, Normal.ry, 0); // double zoom = 0.00001; // GL11.glOrtho( -width/2*zoom, width/2*zoom, -height/2*zoom, height/2*zoom, -1, 1 ); GL11.glColor3d(0.4, 0.9, 0.1); //TODO : Make color class with getGreenFloat and getGreenRGB and chromatic wheel // this.drawLine(new Point(20,20), new Point(20+100,20)); //FasT.getFasT().getLogger().debug("1 meter = " + Normal.normal(100, Unit.cm)); // this.drawLine(new Point(20,40), new Point(20+Normal.toPlan(1),40)); GL11.glColor3d(0, 1, 0); this.drawSquare(new Point(-1, -1).toReal(), new Point(1, 1).toReal()); // this.drawLine(new Point(1,1).toReal(), new Point(1,1).toReal().add(new Point(1,0))); // this.drawLine(new Point(1,10), new Point(20,10)); GL11.glColor3d(0.02, 0.8, 0.95); this.drawLine(new Point(10, 10).mouseToReal(), new Point(10, 10).mouseToReal().add(new Point(1, 0))); //Draw text to show this is 1 meter }
From source file:rheel.ac.client.renderer.TileEntityRendererResearchTable.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix();/*from w w w . jav a 2s .c o m*/ GL11.glTranslated(x + 0.5, y + 0.75, z + 0.5); GL11.glRotatef(180, 1, 0, 0); GL11.glRotatef(90 * tileentity.getBlockMetadata(), 0, 1, 0); ResourceLocation rl = TextureLoader.getModelTexture("ResearchTable.png"); this.bindTexture(rl); TileEntityRendererResearchTable.model.render(); GL11.glPopMatrix(); }