I am trying to rotate a bunch of CALayers around an ellipse (carousel style) as follows:
CGMutablePathRef path = CGPathCreateMutable();
CGAffineTransform squash = CGAffineTransformMakeScale(1.1, 0.8);
CGAffineTransform squashInv = CGAffineTransformInvert(squash);
CGPoint c = CGPointApplyAffineTransform(centre, squashInv);
CGPathAddArc(path, &squash, c.x, c.y, radius, 2.0*M_PI, 0.0, YES);
CAKeyframeAnimation *pathAni = [CAKeyframeAnimation animationWithKeyPath:@"position"];
pathAni.path = path;
pathAni.duration = 14.0;
pathAni.calculationMode = kCAAnimationPaced;
CFRelease(path);
which works great, except that each view always starts animation at the 3 o’clock position. Now I am trying to start each point of view at an arbitrary point in the ellipse and would like to offer some suggestions.
(I tried CGMoveArcToPoint, and also tried to rotate the circle with CGAffineTransformMakeRotate in the way, but to no avail)
thank you for your time
source
share