Android OpenGL ES 开发教程(13):阶段小结

之前介绍了什么是 OpenGL ES ,OpenGL ES 管道的概念,什么是EGL,Android中OpenGL ES的开发包以及GLSurfaceView,OpenGL ES所支持的基本几何图形:点,线,面,已及如何使用这些基本几何通过构成较复杂的图像(20面体)。

但到目前为止还只是绘制2D图形,而忽略了一些重要的概念,3D坐标系,和3D坐标变换,在介绍OpenGL ES Demo程序框架时,创建一个OpenGLRenderer 实现 GLSurfaceView.Renderer接口

public void onSurfaceChanged(GL10 gl, int width, int height) { // Sets the current view port to the new size. gl.glViewport(0, 0, width, height); // Select the projection matrix gl.glMatrixMode(GL10.GL_PROJECTION); // Reset the projection matrix gl.glLoadIdentity(); // Calculate the aspect ratio of the window GLU.gluPerspective(gl, 45.0f, (float) width / (float) height, 0.1f, 100.0f); // Select the modelview matrix gl.glMatrixMode(GL10.GL_MODELVIEW); // Reset the modelview matrix gl.glLoadIdentity(); } }

我们忽略了对glViewport,glMatrixMode,gluPerspective以及20面体时glLoadIdentity,glTranslatef,glRotatef等方法的介绍,这些都涉及到如何来为3D图形构建模型,在下面的几篇将详细介绍OpenGL ES的坐标系和坐标变换已经如何进行3D建模。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值