对OpenGL转换感到困惑 [英] Confused about OpenGL transformations
问题描述
在opengl中,有一个原点为(0,0,0)的世界坐标系.
In opengl there is one world coordinate system with origin (0,0,0).
让我感到困惑的是,所有的转换(例如glTranslate,glRotate等)都在做什么?他们会移动吗 世界坐标中的物体,还是它们移动相机?如您所知,可以通过移动物体或照相机来实现相同的运动.
What confuses me is what all the transformations like glTranslate, glRotate, etc. do? Do they move objects in world coordinates, or do they move the camera? As you know, the same movement can be achieved by either moving objects or camera.
我猜是glTranslate,glRotate,更改对象和gluLookAt会更改相机吗?
I am guessing that glTranslate, glRotate, change objects, and gluLookAt changes the camera?
推荐答案
所有转换都是对对象的转换.甚至gluLookAt都只是一种变换对象,就像将相机放在您要告诉它的位置一样.从技术上讲,它们是顶点上的变换,但这仅仅是语义.
All transformations are transformations on objects. Even gluLookAt is just a transformation to transform the objects as if the camera was where you tell it to be. Technically they are transformations on the vertices, but that's just semantics.
这篇关于对OpenGL转换感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!