views:

53

answers:

1

Need to figure some transformation codes to implement falling down naturally just like leaves falling down from tree.

Here are some codes, fly from one place to another place with some rotation angle.

[UIView beginAnimations:nil context:NULL]; 

[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:5.0];
[UIView setAnimationDelegate:self];
//[UIView setAnimationRepeatCount:1e100f];  //coutless
[UIView setAnimationRepeatCount:1];   // 1 time 
//[UIView setAnimationRepeatAutoreverses:YES];


leaf2.frame = CGRectMake(LEAF2_X, LEAF2_Y, LEAF2_W, LEAF2_H);
leaf2.transform = CGAffineTransformMakeRotation(ANGLE);

[UIView commitAnimations];
A: 

See if the next 2 questions help:

Michael Kessler
yes,helps. actually I need figure out one path just like curve. So need some transformation combination matrix etc.
Forrest