List of usage examples for org.lwjgl.opengl GL11 glRotated
public static native void glRotated(@NativeType("GLdouble") double angle, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:cn.academy.core.client.render.RenderMagInducer.java
License:Open Source License
@Override protected void renderAtOrigin(TileEntity te) { GL11.glRotated(90, 0, 1, 0); super.renderAtOrigin(te); }
From source file:cn.academy.core.client.render.RenderVoid.java
License:Open Source License
public static final void renderHand(EntityPlayer player) { GL11.glDisable(GL11.GL_CULL_FACE);// w ww . ja v a 2 s . c o m GL11.glPushMatrix(); RenderUtils.renderEnchantGlint_Equip(); RenderUtils.loadTexture(steveTexture); GL11.glRotated(-23.75, 0.0F, 0.0F, 1.0F); GL11.glRotated(21.914, 0.0F, 1.0F, 0.0F); GL11.glRotated(32.75, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(.758F, -.072F, -.402F); GL11.glColor3f(1.0F, 1.0F, 1.0F); model.onGround = 0.0F; model.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, player); model.bipedRightArm.render(0.0625F); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); }
From source file:cn.academy.core.client.render.SkillRenderManager.java
License:Open Source License
public static void renderThirdPerson(EntityLivingBase ent, ItemStack stack, ItemRenderType type) { if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || !(ent instanceof EntityPlayer)) return;//w ww .ja v a2 s . co m EntityPlayer player = (EntityPlayer) ent; Item item = stack.getItem(); Block block = Block.getBlockFromItem(stack.getItem()); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); { GL11.glColor4d(1, 0.6, 0.6, 0.55); if (stack.getItemSpriteNumber() == 0 && item instanceof ItemBlock) { //block render routine GL11.glTranslated(0, 0, 1.5); GL11.glScalef(2F, 2F, 2F); GL11.glRotated(45, 1, 0, 1); GL11.glRotated(45, 0, 1, 0); GL11.glRotated(180, 1, 0, 0); } else if (item.isFull3D()) { GL11.glTranslated(0.1, 0.8, -.4); GL11.glScalef(.8F, .8F, .8F); GL11.glRotated(45, 0, 0, -1); } else { GL11.glTranslated(-.3, 1.2, -.6); GL11.glRotatef(90, 1, 0, 0); GL11.glScalef(1.5F, 1.5F, 1.5F); } traverseHandRender(player, HandRenderType.EQUIPPED); } GL11.glPopMatrix(); }
From source file:cn.academy.energy.client.render.block.RenderCatEngine.java
License:GNU General Public License
@Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float pt) { long time = GameTimer.getTime(); TileCatEngine engine = (TileCatEngine) tile; if (engine.lastRender != 0) { engine.rotation += (time - engine.lastRender) * engine.thisTickGen * 1e-2; //System.out.println(engine.thisTickGen); engine.rotation %= 360;//w w w . jav a2 s. c o m } engine.lastRender = time; x += 0.5; z += 0.5; GL11.glPushMatrix(); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glTranslated(x, y + 0.03 * Math.sin(GameTimer.getTime() * 0.006), z); double yaw = Math.atan2(x, z) * 180 / Math.PI; GL11.glRotated(yaw + 180, 0, 1, 0); GL11.glTranslated(0, .5, 0); GL11.glRotated(engine.rotation, 1, 0, 0); GL11.glTranslated(-.5, -.5, 0); Tessellator t = Tessellator.instance; RenderUtils.loadTexture(TEXTURE); t.startDrawingQuads(); t.addVertexWithUV(0, 0, 0, 0, 0); t.addVertexWithUV(1, 0, 0, 1, 0); t.addVertexWithUV(1, 1, 0, 1, 1); t.addVertexWithUV(0, 1, 0, 0, 1); t.draw(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPopMatrix(); }
From source file:cn.academy.energy.client.render.block.RenderMatrix.java
License:GNU General Public License
private void drawShields(TileMatrix mat) { int plateCount = mat.plateCount == 3 ? 3 : 0; long time = GameTimer.getTime(); double dtheta = 360.0 / plateCount, phase = (time / 20.0) % 360; double htPhaseOff = 40.0; for (int i = 0; i < plateCount; ++i) { GL11.glPushMatrix();/* w ww. j a va 2s. c o m*/ double floatHeight = 0.1; GL11.glTranslated(0, floatHeight * Math.sin(time / 900.0 + htPhaseOff * i), 0); GL11.glRotated(phase + dtheta * i, 0, 1, 0); model.renderPart("Shield"); GL11.glPopMatrix(); } }
From source file:cn.academy.energy.client.render.block.RenderSolarGen.java
License:GNU General Public License
@Override public void drawAtOrigin(TileEntity te) { GL11.glRotated(90, 0, 1, 0); super.drawAtOrigin(te); }
From source file:cn.academy.energy.client.render.block.RenderWindGenMain.java
License:GNU General Public License
@Override public void drawAtOrigin(TileEntity te) { TileWindGenMain gen = (TileWindGenMain) te; GL11.glPushMatrix();//ww w . j a va2 s . c o m // draw body RenderUtils.loadTexture(texBody); mdlBody.renderAll(); // draw fan if (gen.isFanInstalled() && gen.noObstacle) { // update fan rotation long time = GameTimer.getTime(); long dt = gen.lastFrame == -1 ? 0 : time - gen.lastFrame; gen.lastFrame = time; gen.lastRotation += gen.getSpinSpeed() * dt / 1000.0; GL11.glPushMatrix(); GL11.glTranslated(0, 0.5, 0.82); GL11.glRotated(gen.lastRotation, 0, 0, -1); RenderUtils.loadTexture(texFan); mdlFan.renderAll(); GL11.glPopMatrix(); } GL11.glPopMatrix(); }
From source file:cn.academy.energy.client.render.tile.RenderMatrix.java
License:Open Source License
private void drawCube(boolean load) { GL11.glTranslated(0, 0.6 * Math.sin(Minecraft.getSystemTime() / 400D), 0); if (load) {//from w w w. j ava 2s . com GL11.glRotated(Minecraft.getSystemTime() / 25D, 1, 1, 1); GL11.glRotated(Minecraft.getSystemTime() / 50D, 2, 0, 1); } else { GL11.glTranslated(0, -1.5, 0); } final double size = 3.2, hs = size * 0.5; GL11.glTranslated(-hs, -hs, -hs); GL11.glColor4d(1, 1, 1, 0.7); RenderUtils.loadTexture(ACClientProps.TEX_MDL_GRID_BLOCK); RenderUtils.drawCube(size, size, size); GL11.glColor4d(1, 1, 1, 1); }
From source file:cn.academy.energy.client.render.tile.RenderNode.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float w) { TileNode node = (TileNode) te;/*from ww w . j av a 2 s . c o m*/ RenderUtils.loadTexture(TEX); GL11.glPushMatrix(); { GL11.glTranslated(x, y, z); for (int i = 0; i < 4; ++i) { GL11.glPushMatrix(); GL11.glTranslated(offsets[i][0], 0, offsets[i][1]); GL11.glRotated(rots[i], 0, 1, 0); //original rect.setSize(1, 1); rect.map.set(0, 0, 32.0 / 34.0, 1); piece.draw(); //energy bar GL11.glTranslated(-0.001, 4 / 32.0, 21.0 / 32.0); double cur = node.getEnergy() / node.getMaxEnergy(); rect.map.set(32.0 / 34.0, 0, 2.0 / 34.0, cur * (15.0 / 32.0)); rect.setSize(2.0 / 34.0, cur * (15.0 / 32.0)); piece.draw(); GL11.glPopMatrix(); } rect.setSize(1, 1); RenderUtils.loadTexture(TEX_BTM); GL11.glPushMatrix(); GL11.glTranslated(1, 0, 0); GL11.glRotated(90, 0, 0, 1); rect.map.set(0, 0, 1, 1); piece.draw(); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 1, 0); GL11.glRotated(-90, 0, 0, 1); piece.draw(); GL11.glPopMatrix(); } GL11.glPopMatrix(); }
From source file:cn.academy.misc.client.render.RendererCoin.java
License:Open Source License
@Override public void doRender(Entity var1, double x, double y, double z, float var8, float var9) { EntityThrowingCoin etc = (EntityThrowingCoin) var1; EntityPlayer player = etc.player;//from w w w . j a v a2s . co m boolean fp = player == Minecraft.getMinecraft().thePlayer && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0; double dt = Minecraft.getSystemTime() - etc.getEntityData().getLong("startTime"); if (etc.isSync) return; GL11.glPushMatrix(); { GL11.glTranslated(x, y, z); if (fp) { GL11.glRotated(player.rotationYaw, 0, -1, 0); } else GL11.glRotated(player.renderYawOffset, 0, -1, 0); GL11.glTranslated(-0.63, -0.60, 0.30); float scale = 0.3F; GL11.glScalef(scale, scale, scale); GL11.glTranslated(0.5, 0.5, 0); GL11.glRotated(dt * 2, etc.axis.xCoord, etc.axis.yCoord, etc.axis.zCoord); GL11.glTranslated(-0.5, -0.5, 0); RenderUtils.renderItemIn2d(0.0625, ACClientProps.TEX_COIN_FRONT, ACClientProps.TEX_COIN_BACK); } GL11.glPopMatrix(); }