Converting pixel co-ordinates to normalized co-ordinates at draw time in OpenGL 3.0
问题 I am drawing a triangle in OpenGL like: MyGLRenderer( ) { fSampleVertices = ByteBuffer.allocateDirect( fSampleVerticesData.length * 4 ) .order ( ByteOrder.nativeOrder( ) ).asFloatBuffer( ); fSampleVertices.put( fSampleVerticesData ).position ( 0 ); Log.d( TAG, "MyGLRender( )" ); } private FloatBuffer fSampleVertices; private final float[] fSampleVerticesData = { .8f, .8f, 0.0f, -.8f, .8f, 0.0f, -.8f, -.8f, 0.0f }; public void onDrawFrame( GL10 unused ) { GLES30.glViewport ( 0, 0, mWidth,