Opengl GL30-GL43解决方案已弃用?基本方框示例

Opengl GL30-GL43解决方案已弃用?基本方框示例,opengl,matrix,render,glu,Opengl,Matrix,Render,Glu,我正在开发一个程序来渲染一个基本长方体,但通过谷歌搜索,我还没有找到在屏幕上绘制一张脸(或一组脸)的解决方案 目前,我找到的每个教程都像这样使用glPushMatrix/glBegin/glEnd/glPopMatrix GL11.glPushMatrix(); GL11.glRotatef(pit, 1, 0, 0); GL11.glRotatef(yaw, 0, 1, 0); GL11.glRotatef(rol, 0, 0, 1); GL11.glTranslatef(pos.x, po

我正在开发一个程序来渲染一个基本长方体,但通过谷歌搜索,我还没有找到在屏幕上绘制一张脸(或一组脸)的解决方案

目前,我找到的每个教程都像这样使用glPushMatrix/glBegin/glEnd/glPopMatrix

GL11.glPushMatrix();

GL11.glRotatef(pit, 1, 0, 0);
GL11.glRotatef(yaw, 0, 1, 0);
GL11.glRotatef(rol, 0, 0, 1);
GL11.glTranslatef(pos.x, pos.y, pos.z);

GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3f(-1.0f, -1.0f,  1.0f);   // Bottom Left Of The Quad
GL11.glVertex3f( 1.0f, -1.0f,  1.0f);   // Bottom Right Of The Quad
GL11.glVertex3f( 1.0f,  1.0f,  1.0f);   // Top Right Of The Quad
GL11.glVertex3f(-1.0f,  1.0f,  1.0f);   // Top Left Of The Quad
//insert similar code here for all 6 faces
GL11.glEnd();

GL11.glPopMatrix();

我在OGL 3.0中读到过,他们不推荐使用glPushMatrix/glBegin/glEnd/GLPOPMARRIX,但我似乎找不到渲染对象的“正确”方法。我应该用什么方法

您需要忘记OpenGL为您管理矩阵的想法。您需要使用向量数学库自己实现这些东西。Java3DAPI在提供一组健壮的矩阵和向量类及方法方面做得很好。很抱歉告诉你,在你的工作中还有更多的工作要做,但这是图形编程的发展方向