Android GLSurfaceView 3D渲染过程演示.rar

上传者: 39840914 | 上传时间: 2021-09-24 09:45:12 | 文件大小: 15KB | 文件类型: RAR
Android GLSurfaceView 例子,演示了自定义GLSurfaceView、自定义渲染器的实现,创建一个3D透视模型的例子,里面涉及到触控笔、坐标、数据缓冲、模式矩阵、绘制图形、透视投影矩阵等相关技巧例子,写有几个自定义方法用以实现指定功能,比如:自定义的渲染器、创建顶点着色数据缓冲、顶点颜色值数组,每个顶点4个色彩值RGBA、为画笔指定顶点坐标数据、设置当前矩阵为单位矩阵、计算透视投影的比例、启用深度测试、关闭抗抖动、角度缩放比例等技巧。
  //创建顶点坐标数据缓冲代码如下:
  ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length*4);
  vbb.order(ByteOrder.nativeOrder());//设置字节顺序
  mVertexBuffer = vbb.asIntBuffer();//转换为int型缓冲
  mVertexBuffer.put(vertices);//向缓冲区中放入顶点坐标数据
  mVertexBuffer.position(0);//设置缓冲区起始位置
  更多代码请下载源码。

文件下载

资源详情

[{"title":"( 12 个子文件 15KB ) Android GLSurfaceView 3D渲染过程演示.rar","children":[{"title":"codesc.net","children":[{"title":"GLSurfaceView","children":[{"title":"res","children":[{"title":"drawable-ldpi","children":[{"title":"icon.png <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-hdpi","children":[{"title":"icon.png <span style='color:#111;'> 4.05KB </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 171B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"icon.png <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"main.xml <span style='color:#111;'> 382B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"assets","children":null,"spread":false},{"title":"default.properties <span style='color:#111;'> 449B </span>","children":null,"spread":false},{"title":"gen","children":[{"title":"wyf","children":[{"title":"ytl","children":[{"title":"R.java <span style='color:#111;'> 629B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"src","children":[{"title":"wyf","children":[{"title":"ytl","children":[{"title":"MyGLSurfaceView.java <span style='color:#111;'> 5.31KB </span>","children":null,"spread":false},{"title":"Sample_8_3.java <span style='color:#111;'> 990B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'> 846B </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 280B </span>","children":null,"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 672B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明