有没有一种方法可以定义或获取在 gluPerspective 方法创建的视锥体中可见的坐标?我的四边形不会显示。这是初始化代码:
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GLU.gluPerspective(45, width/height, 1, 100);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glViewport(0, 0, 800, 600);
GL11.glClearColor(1, 1, 1, 1);
这是渲染代码:
GL11.glLoadIdentity();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
GL11.glColor3f(0, 0, 0);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3f(1, 1, 5);
GL11.glVertex3f(10, 1, 5);
GL11.glVertex3f(10, 10, 5);
GL11.glVertex3f(1, 10, 5);
GL11.glEnd();