¡@

Home 

2014/10/15 ¤U¤È 10:15:02

iphone Programming Glossary: totalradians

Rotating image using objective C

http://stackoverflow.com/questions/4010779/rotating-image-using-objective-c

location touch locationInView self superview float theAngle atan2 location.y self.center.y location.x self.center.x totalRadians theAngle self rotateImage theAngle void touchesEnded NSSet touches withEvent UIEvent event void rotateImage float angleRadians.. question Instead of creating the transformation from the angle that your getting from the touch try incrementing totalRadians by its difference from the new angle and then create the transform from that. void touchesMoved NSSet touches withEvent.. location touch locationInView self superview float theAngle atan2 location.y self.center.y location.x self.center.x totalRadians fabs theAngle totalRadians totalRadians fmod totalRadians 2 M_PI self rotateImage totalRadians share improve this answer..