答案 0 :(得分:1)
您可以尝试一下。
public synchronized void setMotion(float xDistance, float yDistance) {
kx = kx + xDistance * 0.001f;
ky = ky + yDistance * 0.001f;
x = (float) (radius * Math.cos(ky) * Math.sin(kx));
z = (float) (radius * Math.cos(ky) * Math.cos(kx));
y = (float) (radius * Math.sin(ky));
float[] up =
{
(float) (Math.sin(ky) * Math.sin(kx)),
(float) (Math.cos(ky)),
(float) (Math.sin(ky) * Math.cos(kx)),
};
Matrix.setLookAtM(viewMatrix, 0,
x, -y, z,
0f, 0f, 0f,
up[0], up[1], up[2]
);
}