Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-14-2011, 03:50 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 4
alladin is on a distinguished road
Default Rotating image jumps on first touch

I am trying to rotate an image. The wheel animation is required to go back and forth as if it were generating momentum and on release it will turn clockwise.

I have all that working however, on first touch the wheel jumps as its starting point has become from where my finger touchdown rather than from its current standing position. I understand why its doing it but i have no idea how make it so there is no jump.

Code:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:wheelImage];
xleg = location.x-starttoset.x;
yleg = location.y-starttoset.y; 
swipetimer = CFAbsoluteTimeGetCurrent();
CGAffineTransform transforms;

location = [touch locationInView:wheelImage];
float theAngle = atan2( location.y-wheelImage.center.y, location.x-wheelImage.center.x );


transforms = CGAffineTransformConcat(spinningWheelImage.transform,CGAffineTransformMakeRotation(theAngle));

}

I realise i should be using degrees however, This doesnt allow the anti-clockwise animation.

Code:
totalRadians += fabs(theAngle - totalRadians);
    totalRadians = fmod(totalRadians, 2*M_PI);
Any ideas for i can resolve this?
alladin is offline   Reply With Quote
Old 07-14-2011, 12:47 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 4
alladin is on a distinguished road
Default Help please!

If anyone can shed any light regarding the issue above please get in contact.
alladin is offline   Reply With Quote
Reply

Bookmarks

Tags
ipad, objective-c, transformmakerotation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 373
9 members and 364 guests
apatsufas, chemistry, Kirkout, leostc, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0