openGL的project matrix 和 model matrix
来源:互联网 发布:js防水涂膜厚度 编辑:程序博客网 时间:2024/06/14 12:38
最近和juanL两个人调openGL,现在才把一些东西搞清楚
project matrix 相当于是内参,自己设置的一些东西,可以通过gluperspective之类的函数设置
model matrix 相当于外参, 就是R和T。
一般情况下,程序都至少会调用设置project matrix一次,如我们通常在reshape回调函数里设置gluperspective函数(因为不管怎么样所有的回调函数都得至少跑一次
,如下面的resizeGL函数,就是通过调用这个函数让我们设置内参数。)
就是因为如果窗口发生变化的话,我们的project matrix得重新设置,一般都是
void GLWidget::resizeGL(int width, int height)
{
if ( height == 0 )
{
height = 1;
}
glViewport( 0, 0, (GLint)width, (GLint)height );
glMatrixMode( GL_PROJECTION ); // 开始设置project matrix
glLoadIdentity(); // 清楚影响
gluPerspective( 45.0, (GLfloat)width/(GLfloat)height, 0.1, 100.0 ); // 设置project matrix
glMatrixMode( GL_MODELVIEW ); // 开始设置model matrix
glLoadIdentity();
}
可以多看看红宝书。
整个openGL就是一个起到一个摄像机的作用。
- openGL的project matrix 和 model matrix
- opengl matrix
- Model View Matrix,Projection Matrix
- Android openGL ES2.0 Matrix.frustumM和Matrix.setLookAtM解析
- Android openGL ES2.0 Matrix.frustumM和Matrix.setLookAtM解析
- Android openGL ES2.0 Matrix.frustumM和Matrix.setLookAtM解析
- OpenGL: OpenGL Matrix Library
- OpenGL es2.0 配置自己的matrix
- OpenGL Matrix Library
- view Matrix in opengl
- OpenGL Projection Matrix
- OpenGL Projection Matrix
- OpenGL Projection Matrix(转)
- OpenGL Matrix Column-Major
- OpenGL Perspective Projection Matrix
- OpenGL Perspective Projection Matrix
- OpenGL Perspective Projection Matrix
- OpenGL Perspective Projection Matrix
- 错误ORA-00314 ORA-03113,ORA-03113
- SQL:要求查询出用户信息,根据用户发表的信息个数对用户进行排序
- C++关键字简介
- C#同步网络时间
- winform打包发布安装包详解
- openGL的project matrix 和 model matrix
- Java编程中“为了性能”需做的26件事《转》
- mysql有时候忘记密码了怎么办?MySQL 5.5举例
- _MSC_VER 定义编译器的版本
- C#操作Word
- Flash图像裁剪上传组件
- 网络程序设计(一)必要文件
- 13-01-18-->3
- window7 32位和64位区别