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:cn.lambdalib.cgui.gui.CGui.java
License:MIT License
private void drawTraverse(double mx, double my, Widget cur, WidgetContainer set, Widget top) { try {/* w ww . j a va 2 s . c om*/ if (cur != null && cur.isVisible()) { GL11.glPushMatrix(); GL11.glTranslated(cur.x, cur.y, 0); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glScaled(cur.scale, cur.scale, 1); GL11.glTranslated(-cur.transform.pivotX, -cur.transform.pivotY, 0); GL11.glColor4d(1, 1, 1, 1); //Force restore color for any widget cur.post(new FrameEvent((mx - cur.x) / cur.scale, (my - cur.y) / cur.scale, cur == top)); GL11.glPopMatrix(); } } catch (Exception e) { LambdaLib.log.error("Error occured handling widget draw. instance class: " + cur.getClass().getName() + ", name: " + cur.getName()); e.printStackTrace(); } if (cur == null || cur.isVisible()) { Iterator<Widget> iter = set.iterator(); while (iter.hasNext()) { Widget wn = iter.next(); drawTraverse(mx, my, wn, wn, top); } } }
From source file:cn.lambdalib.multiblock.RenderBlockMultiModel.java
License:MIT License
@Override public void drawAtOrigin(TileEntity te) { GL11.glColor4d(1, 1, 1, 1);/*from w w w. jav a 2 s .com*/ if (tex != null) { RenderUtils.loadTexture(tex); } GL11.glRotated(rotateY, 0, 1, 0); GL11.glScaled(scale, scale, scale); mdl.render(te, 0, 0); }
From source file:cn.lambdalib.template.client.render.block.RenderTileEntityModel.java
License:MIT License
@Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { GL11.glPushMatrix();/*from ww w .ja v a2 s . co m*/ { GL11.glTranslated(d0 + .5, d1 + yOffset, d2 + .5); if (reverse) { GL11.glScaled(-scale, -scale, scale); } else { GL11.glScaled(scale, scale, scale); } RenderUtils.loadTexture(texture); model.render(tileentity, 0F, 0F); } GL11.glPopMatrix(); }
From source file:cn.lambdalib.template.client.render.item.RenderModelItem.java
License:MIT License
public void renderInventory() { GL11.glDisable(GL11.GL_CULL_FACE);//from ww w . j a va 2 s . c o m GL11.glPushMatrix(); { RenderUtils.loadTexture(texturePath); GL11.glTranslated(8.0F + invOffset.x, 8.0F + invOffset.y, 0.0F); GL11.glScaled(16F * invScale, 16F * invScale, 16F * invScale); float rotation = 145F; if (inventorySpin) rotation = GameTimer.getAbsTime() / 100F; GL11.glRotatef(rotation, 0, 1, 0); this.doRotation(invRotation); GL11.glScalef(-1F, -1F, 1F); renderAtStdPosition(); } GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); }
From source file:cn.lambdalib.template.client.render.item.RenderModelItem.java
License:MIT License
public void renderEntityItem(RenderBlocks render, EntityItem ent) { GL11.glPushMatrix();/*from www . j a v a 2 s .c o m*/ { RenderUtils.loadTexture(texturePath); this.doRotation(entityItemRotation); this.doTransformation(entityItemOffset); GL11.glScaled(entityItemScale, entityItemScale, entityItemScale); renderAtStdPosition(); } GL11.glPopMatrix(); }
From source file:cn.lambdalib.template.client.render.item.RenderModelItem.java
License:MIT License
public void renderEquipped(ItemStack item, RenderBlocks render, EntityLivingBase entity, ItemRenderType type) { if (item.stackTagCompound == null) item.stackTagCompound = new NBTTagCompound(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix();//from ww w . j av a 2 s . com { RenderUtils.loadTexture(texturePath); float sc2 = 0.0625F; GL11.glRotatef(40F, 0, 0, 1); if (type == ItemRenderType.EQUIPPED) this.doTransformation(thirdPersonOffset); this.doTransformation(equipOffset); this.doRotation(equipRotation); GL11.glRotatef(90, 0, -1, 0); GL11.glScaled(equipScale, equipScale, equipScale); if (type == ItemRenderType.EQUIPPED) GL11.glScaled(thirdPersonScale, thirdPersonScale, thirdPersonScale); renderAtStdPosition(getModelAttribute(item, entity)); } GL11.glPopMatrix(); }
From source file:cn.lambdalib.template.client.render.item.RenderModelItem.java
License:MIT License
protected void renderAtStdPosition(float i) { GL11.glScaled(scale, scale, scale); GL11.glDisable(GL11.GL_CULL_FACE);/*from ww w. ja v a 2 s. c om*/ this.doTransformation(stdOffset); GL11.glScalef(-1F, -1F, 1F); GL11.glRotated(stdRotation.yCoord + 180, 0.0F, 1.0F, 0.0F); GL11.glRotated(stdRotation.zCoord, 0.0F, 0.0F, 1.0F); GL11.glRotated(stdRotation.xCoord, 1.0F, 0.0F, 0.0F); model.render(null, 0.0625F, i); GL11.glEnable(GL11.GL_CULL_FACE); }
From source file:cn.lambdalib.util.client.RenderUtils.java
License:MIT License
public static void glScale(Vec3 v) { GL11.glScaled(v.xCoord, v.yCoord, v.zCoord); }
From source file:cn.lambdalib.vis.model.CompTransform.java
License:MIT License
public void doTransform() { RenderUtils.glTranslate(VecUtils.add(transform, pivotPt)); GL11.glRotated(rotation.xCoord, 1, 0, 0); GL11.glRotated(rotation.yCoord, 0, 1, 0); GL11.glRotated(rotation.zCoord, 0, 0, 1); GL11.glScaled(scale, scale, scale); RenderUtils.glTranslate(VecUtils.neg(pivotPt)); }
From source file:cn.liutils.api.gui.LIGui.java
License:Open Source License
private void drawTraverse(double mx, double my, WidgetNode cur, Iterable<WidgetNode> set, WidgetNode top) { if (cur != null && cur.widget.doesDraw) { GL11.glPushMatrix();/*from www. ja va2 s.co m*/ GL11.glTranslated(cur.x, cur.y, 0); GL11.glScaled(cur.scale, cur.scale, 1); //System.out.println(cur.widget + " " + DebugUtils.formatArray(cur.x, cur.y, cur.scale)); GL11.glColor4d(1, 1, 1, 1); //Force restore color for any widget cur.widget.draw((mx - cur.x) / cur.scale, (my - cur.y) / cur.scale, cur == top); GL11.glPopMatrix(); } if (cur == null || cur.widget.doesDraw) { if (cur != null) cur.iterating = true; Iterator<WidgetNode> iter = set.iterator(); while (iter.hasNext()) { WidgetNode wn = iter.next(); drawTraverse(mx, my, wn, wn, top); } if (cur != null) cur.iterating = false; } }