【发布时间】:2016-07-07 20:16:48
【问题描述】:
我在我的 3D 世界中生成了一个基本立方体。我可以围绕相机正确旋转,但是当我旋转后平移时,平移不正确。 例如,如果我旋转 90 度并平移到 Z 轴,它会像在 X 轴上平移一样移动。
glLoadIdentity();
glRotatef(angle,0,1,0); //Rotate around the camera.
glTranslatef(movX,movY,movZ); //Translate after rotating around the camera.
glCallList(cubes[0]);
我需要一些帮助。另外,我尝试在旋转之前进行平移,但旋转不在相机上。它位于立方体的边缘。
【问题讨论】: