GL_LINE_STIPPLE不能正常工作

时间:2014-05-28 17:04:05

标签: java opengl jogl

所以这应该是一个点状的三角形,但我得到的只是法线。有什么想法可能导致这个问题吗?

private void render(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();
    gl.glViewport(0, 0 , 1000, 1000);
    gl.glClear(GL.GL_COLOR_BUFFER_BIT);


    short  stipple = (short)0xAAAA;
    ((GL2) gl).glLineStipple( 1, stipple );
    gl.glEnable(GL_LINE_STIPPLE);
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glVertex3f(0f, 0.75f, 0);
    gl.glVertex3f(0.5f, -0.25f, 0);
    gl.glVertex3f(-0.5f, -0.25f, 0);
    gl.glVertex3f(0f, 0.75f, 0);        
    gl.glEnd();  
    gl.glDisable(GL_LINE_STIPPLE);}

0 个答案:

没有答案