I have the following code that rotates CALayer -45 degrees on the y axis:
#define D2R(x) (x * (M_PI/180.0)) - (void) swipe:(UISwipeGestureRecognizer *)recognizer { CATransform3D transform = CATransform3DMakeRotation(D2R(-45), 0, 1.0, 0); transform.m34 = -1.0 / 850; CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath: @"transform"]; transformAnimation.fillMode = kCAFillModeForwards; transformAnimation.removedOnCompletion = NO; transformAnimation.toValue = [NSValue valueWithCATransform3D:transform]; transformAnimation.duration = 0.5; [self.layer addAnimation:transformAnimation forKey:@"transform"]; }
The animation works, except that it ends without perspective - ignoring the m34 setting if I understand things correctly.
Halfway through:

In the end:

What am I doing wrong?
source share