![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android openGL
sunxiaolin2016
只争朝夕
展开
-
安卓OpenGL之GLES20常用接口解析
1.glClearColor//设置SurfaceView的背景颜色为灰色。GLES20.glClearColor(0.5f, 0.5f, 0.5f, 0.5f); //native层接口原型public static native void glClearColor( float red, //范围0-1.0f float green, //范...原创 2019-05-24 12:22:47 · 4891 阅读 · 0 评论 -
Android P OpenGL之显示图片
使用OpenGL显示一张图片。工程源码:https://github.com/sunxiaolin2016/OpenglOneGLImageHandlerGLImageHandler中封装了图片显示的方法.NO_FILTER_VERTEX_SHADER和NO_FILTER_FRAGMENT_SHADER 分别是顶点着色器程式和片段着色器程式。init(),OpenGL初始化操作,创建着色...原创 2019-09-15 15:19:13 · 1668 阅读 · 0 评论 -
OpenGL之glScissor()使用方法
在OpenGL中,我们经常使用glClearColor和glClear来清除缓冲区。用法如下://将整个画布区域填充成红色glViewport(0, 0, sWidth, sHeight);glClearColor(0.8f, 0.1f, 0.2f, 1.0f);glClear(GL_COLOR_BUFFER_BIT);glClear会将整个画布区域填充,但是我们不想OpenGL绘制...原创 2019-09-24 14:06:17 · 3464 阅读 · 0 评论 -
OpenGL之常用方法整理
1、sincosf官网资料:https://linux.die.net/man/3/sincosf相关:#include <math.h>void sincos(double x, double *sin, double *cos);void sincosf(float x, float *sin, float *cos);void sincosl(long double ...原创 2019-09-25 17:29:35 · 502 阅读 · 0 评论 -
OpenGL之弧度和角度的换算
公式:1角度=π/180弧度1弧度=180/π度代码:#define M_PI 3.14159265358979323846static const float kDegreesToRadians = M_PI / 180.0f;//角度转换成弧度float yaw;yaw = yaw * kDegreesToRadians;//弧度转换成角度float yaw;yaw...原创 2019-09-25 17:59:49 · 1214 阅读 · 0 评论 -
OpenGL之视图矩阵View Matrix
OpenGL矩阵中有一个重要的矩阵,视图矩阵。把物体从世界坐标系转化到视点坐标系的矩阵称为视图矩阵。记录一下用过的经验。/**Store the view matrix. This can be thought of as our camera. This matrix transforms world space to eye space;it positions things re...原创 2019-09-26 15:55:48 · 2363 阅读 · 0 评论