Hi, I am trying to spin a wheel on its axis -- setting it in motion using the mouse. Specifically, I am trying to spin a roulette wheel.
I calculate a delta x and delta y by getting the difference of x1 x2 and y1 y2. I can see in console via NSLOG msgs that it is ok. I use these values to calculate velocity.
CABasicAnimation *fullRotation; fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; fullRotation.fromValue = [ NSNumber numberWithFloat:0 ] ; fullRotation.toValue = [NSNumber numberWithFloat:(((360*M_PI)/180)) ; fullRotation.duration = duration ; fullRotation.repeatCount = repeat ;
[myview.layer addAnimation:fullRotation forKey:@"360"];
The above code gives me fluid animation, but the wheel always completes a full circle, which would be not very realistic.
Can anyone suggest a method for spinning the wheel by smaller amounts that still gives fluid animation? When I use the above, the wheel doesn't move at all for smaller amounts.
Thank you!
Piesia