Advertisement
Guest User

Untitled

a guest
Dec 29th, 2015
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. GlStateManager.pushMatrix();
  2. GlStateManager.translate(x + 0.5, y + 1.25, z + 0.5);
  3. GlStateManager.rotate(180 - Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
  4. GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
  5. GlStateManager.scale(0.25, 0.25, 0.25);
  6.  
  7. GlStateManager.color(1, 1, 1, 1);
  8. GlStateManager.disableTexture2D();
  9. GlStateManager.disableAlpha();
  10. GlStateManager.disableLighting();
  11. GlStateManager.enableBlend();
  12. GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  13. GlStateManager.shadeModel(GL11.GL_SMOOTH);
  14.  
  15. WorldRenderer renderer = Tessellator.getInstance().getWorldRenderer();
  16. renderer.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
  17. renderer.pos(0, 0, 0).color(0, 1f, 0, 0f).endVertex();
  18. double angle2 = Math.toRadians(180);
  19. for (double theta = 0; theta <= angle2; theta += (2 * Math.PI / 360)) {
  20.     renderer.pos(Math.cos(theta), Math.sin(theta), 0).color(0f, 1f, 0f, 1f).endVertex();
  21. }
  22. Tessellator.getInstance().draw();
  23.  
  24. GlStateManager.shadeModel(GL11.GL_FLAT);
  25. GlStateManager.enableTexture2D();
  26. GlStateManager.enableAlpha();
  27. GlStateManager.enableLighting();
  28. GlStateManager.disableBlend();
  29. GlStateManager.popMatrix();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement