我有一个 View ,我想在两个不同的方向上旋转。
第一个是:
arrowImageView.layer.transform = CATransform3DMakeRotation(rotationAngle, 0, 0, 1)
第二个是:
arrowImageView.layer.transform = CATransform3DMakeRotation(pitch, 1, 0, 0)
如何在不取消其中一个的情况下合并这两个旋转?
最佳答案
您将 3D 转换与 CATransform3DConcat()
相结合:
let t1 = CATransform3DMakeRotation(rotationAngle, 0, 0, 1)
let t2 = CATransform3DMakeRotation(pitch, 1, 0, 0)
arrowImageView.layer.transform = CATransform3DConcat(t1, t2)
关于ios - 如何在不相互抵消的情况下组合 2 个 3D 旋转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31762207/