我正在与代码战斗,使它围绕物体旋转相机。我使用的代码是:opengl相机围绕物体旋转
eyeX = (float) (obj.x + 500*Math.cos(Math.toRadians(angle))*Math.sin(Math.toRadians(angle))); eyeY = (float) (obj.y + 500*Math.sin(Math.toRadians(angle))*Math.sin(Math.toRadians(angle))); eyeZ = (float) (obj.z + 500*Math.cos(Math.toRadians(angle))); Matrix.setLookAtM(mViewMatrix, 0, eyeX, eyeY, eyeZ, obj.x, obj.y, obj.z, 0, 1, 0);
如果obj是我想围绕旋转的摄像头型号,并且角度由1战平每递增。有人可以解释这个问题,我做错了什么?
不管怎样,它仍然没有帮助。 –