異なる z 深度の CAlayers があり、z 深度で変換して、この方法を使用して試したすべてのレイヤーを表示したい:
CATransform3D transform = CATransform3DMakeTranslation(0, 0,-50 );
rootLayer.sublayerTransform = transform;
しかし、変化はなく、この方法を使用してみました
CATransform3D transform = CATransform3DRotate(trackball->baseTransform, 30, 30 , 0 , 0 );
rootLayer.sublayerTransform = transform;
for (CALayer* layer in rootLayer.sublayers)
{
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"zPosition"];
theAnimation.fromValue=[NSNumber numberWithFloat:-40]; // [NSNumber numberWithFloat:frandom(800, 400)];
theAnimation.toValue=[NSNumber numberWithFloat:200]; // [NSNumber numberWithFloat:frandom(-300, -100)];
theAnimation.duration=8;
theAnimation.repeatCount = 1e100;
[layer addAnimation:theAnimation forKey:@"zPosition"];
}
y方向に移動しました
注: iPad の向きは横向きです。