Ho il seguente codice che ruota una CALayer dal -45degrees sull'asse Y:mio CALayer trasformare tiene dopo l'animazione, ma la prospettiva scompare
#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"];
}
Le opere di animazione, tranne che si conclude con nessuna prospettiva - ignorando la mia impostazione m34 se sto capendo le cose correttamente.
metà:
Alla fine:
Che cosa sto facendo di sbagliato?