glOrtho OpenGL es 2.0 variant how fix blank screen?

前端 未结 1 632
不知归路
不知归路 2021-01-26 08:07

I try to remake a OpenGL ES 2.0 example for Android http://developer.android.com/resources/tutorials/opengl/opengl-es20.html to Android NDK OpenGL ES 2.0 example.

I

相关标签:
1条回答
  • 2021-01-26 08:12

    For one thing your triangle appears to be clipped by the near plane. Your default view is at 0,0,0 looking down the -z axis, and your triangle is on the z axis at position 0, and you have a near plane of 1.

    Either move your triangle down the negative z axis (try -5 for all vertices), or move your near plane backwards (you can make it negative if you want as well, try -10 to 10).

    0 讨论(0)
提交回复
热议问题