Advertisement
Creepinson

Untitled

Jun 26th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1.  
  2. public static void drawCube(AxisAlignedBB cube) {
  3.  
  4. double xa = cube.minX;
  5.  
  6. double xb = cube.maxX;
  7.  
  8. double ya = cube.minY;
  9.  
  10. double yb = cube.maxY;
  11.  
  12. double za = cube.minZ;
  13.  
  14. double zb = cube.maxZ;
  15.  
  16.  
  17.  
  18.  
  19.  
  20. Tessellator tessellator = Tessellator.getInstance();
  21.  
  22. VertexBuffer worldRenderer = tessellator.getBuffer();
  23. worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
  24. worldRenderer.color(0,1,1,1);
  25. worldRenderer.pos(xa, ya, za);
  26. worldRenderer.endVertex();
  27. worldRenderer.pos(xa, yb, za);
  28. worldRenderer.endVertex();
  29. worldRenderer.pos(xb, yb, za);
  30. worldRenderer.endVertex();
  31. worldRenderer.pos(xb, ya, za);
  32. worldRenderer.endVertex();
  33. worldRenderer.pos(xa, ya, za);
  34. worldRenderer.endVertex();
  35.  
  36. Utils.getLogger().info("TRYING TO DRAW BOX");
  37.  
  38. worldRenderer.pos(xa, ya, zb);
  39. worldRenderer.endVertex();
  40. worldRenderer.pos(xa, yb, zb);
  41. worldRenderer.endVertex();
  42. worldRenderer.pos(xb, yb, zb);
  43. worldRenderer.endVertex();
  44. worldRenderer.pos(xb, ya, zb);
  45. worldRenderer.endVertex();
  46. worldRenderer.pos(xa, ya, zb);
  47. worldRenderer.endVertex();
  48.  
  49. tessellator.draw();
  50.  
  51.  
  52.  
  53. worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
  54. worldRenderer.color(0,1,1,1);
  55. worldRenderer.pos(xa, ya, za);
  56. worldRenderer.endVertex();
  57. worldRenderer.pos(xa, ya, zb);
  58. worldRenderer.endVertex();
  59.  
  60.  
  61. worldRenderer.pos(xa, yb, za);
  62. worldRenderer.endVertex();
  63. worldRenderer.pos(xa, yb, zb);
  64. worldRenderer.endVertex();
  65.  
  66.  
  67. worldRenderer.pos(xb, ya, za);
  68. worldRenderer.endVertex();
  69. worldRenderer.pos(xb, ya, zb);
  70. worldRenderer.endVertex();
  71.  
  72.  
  73. worldRenderer.pos(xb, yb, za);
  74. worldRenderer.endVertex();
  75. worldRenderer.pos(xb, yb, zb);
  76. worldRenderer.endVertex();
  77.  
  78. tessellator.draw();
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement