Hello all.
Im sorry maybe a little bit OT, because this is more mathematical, but I dunno
how to achieve it.
First, I have a view, which I can rotate, I can move around doing this:
UITouch *aTouch = [touches anyObject];
CGPoint loc = [aTouch locationInView:self];
CGPoint prevloc = [aTouch previousLocationInView:self];
CGRect myFrame = self.frame;
float deltaX = loc.x - prevloc.x;
float deltaY = loc.y - prevloc.y;
myFrame.origin.x += deltaX;
myFrame.origin.y += deltaY;
[self setFrame:myFrame];
but when I apply a rotation like:
self.transform = CGAffineTransformMakeRotation(radians(n));
where n is the degrees angle, then when I move the view it moves really funny,
or it simple disappear because of the values Im getting from deltaY and deltaX.
So I guess I have to take in mind the angle that it has to have a successful
movement no matter the angle the view has.
so getting the CGAffineTransform matrix from the view, i need to calculate the
angle that has and then do some operation on when calculating the new deltaX
and deltaY, right?
Any help or tip may be appreciate, my linear algebra is not that good ... :SS I
wanna cry...
Thx
Gustavo_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]