Opengl GL4中是否存在glTranslatef()?

Opengl GL4中是否存在glTranslatef()?,opengl,jogl,Opengl,Jogl,我试图在JOGL中使用glTranslatef(),但在NetBeans中使用glTranslatef()时收到“找不到符号”错误。glTranslatef()是否存在于JOGL 2中?我是不是错过了一个重要环节 以下是我的作品: import com.jogamp.opengl.GL4; import com.jogamp.opengl.GLAutoDrawable; import com.jogamp.opengl.GLEventListener; import com.jogamp.ope

我试图在JOGL中使用glTranslatef(),但在NetBeans中使用glTranslatef()时收到“找不到符号”错误。glTranslatef()是否存在于JOGL 2中?我是不是错过了一个重要环节

以下是我的作品:

import com.jogamp.opengl.GL4;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.util.*;
以下是受影响的代码:

@Override
public void display(GLAutoDrawable drawable) {
    final GL4 gl = drawable.getGL().getGL4();

    // clears the window to black
    gl.glClear(GL4.GL_COLOR_BUFFER_BIT);
    // draw the shape
    gl.glBindVertexArray(triangleVaoHandle[0]);
    gl.glDrawArrays(GL4.GL_TRIANGLES, 0, 3);
    gl.glTranslatef(0.0f, 0.0f, 0.0f); // the error is here, cannot find symbol glTranslatef(float, float, float)

    // ensure completed rendering is pushed onto the screen
    gl.glFlush();
} 
在向后兼容的上下文中仍然可用,如果确实要使用固定管道,请使用而不是

没有名为“JOGL 4.0”的内容,请阅读以了解OpenGL和JOGL版本号以及更多信息。2020年8月的最新稳定版本是JOGL 2.3.2,最新候选版本目前是JOGL 2.4.0

请向JOGL询问有关的具体问题。StackOverflow适用于一般OpenGL问题,但不适用于关于JogAmp的问题,因为只有极少数的维护人员和贡献者来到这里

我建议你也看看我们的维基,找到简单的例子。jogl中的。

可以通过。 您可以使用获取属于固定函数管道的。

的实例,并将固定函数矩阵堆栈的当前矩阵乘以转换矩阵。现在的顶点变换是在中完成的,这个函数是无用的。