逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::
Viewing: Specify the location of the viewer or camera.
Modeling: Move objects around in a scene.
Viewing transformation is essentially nothing but a modeling transformation. They are used to made purely as a convenience to the programmer. 
The term modelview indicats that viewing transformation and modeling transformation are combined in the transformation pipeline into a single matrix-modelview matrix.
Viewing transformation全局的移动所有的物体. 
Modeling transformation一般是局部的移动物体, 当然也可以全局的移动.

glTranslatef();
glRotatef();
注意, 变换可以看成是对坐标系进行变换, 也可以看成是对物体的坐标进行变换, 而坐标系不受影响.
1. 对物体坐标进行变换: 因为矩阵的管理使用的是栈的形式, 所以实际上是glRotatef()先执行, 然后glTranslatef()后执行, 即先旋转, 后移动, 与代码的顺序正好相反. 实际内部是这样进行的, 但是这样一来, 矩阵的变换语句就得逆着来. 这也是为什么顶点坐标向量在OpenGL中要放在右边, 而变换矩阵要放在左边进行相乘.
2. 对坐标系进行变换: 这样就好理解一些, 因为变换结果与变换语句的顺序是一致的.
posted on 2009-05-15 03:38 逛奔的蜗牛 阅读(414) 评论(0)  编辑 收藏 引用 所属分类: OpenGL

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理