这里中心点是我的代码:Libgdx相机绕上为:eulerAngles
private Quaternion getRotatedQuaternion(float pitch, float yaw, float roll) {
tempQuat.setEulerAngles(pitch, yaw, roll);
rotationQuat.mulLeft(tempQuat);
return rotationQuat;
}
和
camera.view.setToLookAt(tempPos, tempLookat, Axis.UP);
Quaternion rotQuat = getRotatedQuaternion(gestureListener.getXAngle(), gestureListener.getYAngle(), 0);
camera.view.rotate(rotQuat);
camera.combined.set(camera.projection);
Matrix4.mul(camera.combined.val, camera.view.val);
这是中央的摄像头转动,对0,0,0。通过这种方式解决了万向节锁问题。但是,我怎样才能为它添加一个新的中心点?
基本上我想旋转的摄像头在我的对象,而不是0,0,0
感谢
使用矢量这将做万向节锁定,是不是对我好! – lacas
“云台锁”是什么意思? –
https://en.m.wikipedia.org/wiki/Gimbal_lock – lacas