我试图在 minecraft 中绘制一些四边形,但这是我遇到的问题:http: //imgur.com/DgnAqv1但它应该在每一侧绘制三角形,所以总共应该有 4 个三角形,我不知道为什么这不起作用。
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(0F, 0.5F, 0.8F, 1F);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX + 1, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ + 1);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX - 1, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ - 1);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX - 1, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ + 1);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX + 1, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ - 1);
GL11.glVertex3d(ep.posX - RenderManager.renderPosX, ep.posY + ep.height + 0.5D - RenderManager.renderPosY, ep.posZ - RenderManager.renderPosZ);
GL11.glEnd();
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glPopMatrix();