简单的核心animationUIView的3D变换

我试图用CA做简单的部分翻转animation,但是我的视angular有问题。 我试着用:

[UIView animateWithDuration:1.0 animations:^{ self.someView.layer.anchorPoint = CGPointMake(0.5, 0); self.someView.layer.transform = CATransform3DMakeRotation(M_PI*0.6,1.0,0.0,0.0); } completion:^(BOOL finished){ // code to be executed when flip is completed }]; 

如何得到这个不错的观点?

在这里输入图像说明

这样的事情会做:

 CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; rotationAndPerspectiveTransform.m34 = 1.0 / -1000.0; rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI * 0.6, 1.0f, 0.0f, 0.0f); [UIView animateWithDuration:1.0 animations:^{ self.someView.layer.anchorPoint = CGPointMake(0.5, 0); self.someView.layer.transform = rotationAndPerspectiveTransform; } completion:^(BOOL finished){ // code to be executed when flip is completed }]; 

如何将透视变换应用于UIView?

请参阅问题的答案。

基本上你可以修改控制多less物体收缩到背景中的matrix的m34。

如果你更好奇的话可以查看http://www.songho.ca/opengl/gl_projectionmatrix.html