在Processing 2+中,如何制作一个可以在世界空间中移动和旋转的摄像机?
我已经有一个摄像机,可以在世界空间中移动并具有某种旋转:
frustum(-10,10,-10,10,10,2000);
translate(camX,camY,camZ);//I move around by adding to these values when a button is pressed
rotate(angleX,1,0,0);//same here...
rotate(angleY,0,1,0);
rotate(angleZ,0,0,1);
这个问题的关键在于旋转是以场景为中心进行的,这意味着当远离场景中心坐标时,我会得到非常奇怪的旋转。为什么在旋转之前进行了平移,这种情况还会发生?