Re: Obtaining rotation from CTM
Re: Obtaining rotation from CTM
- Subject: Re: Obtaining rotation from CTM
- From: David Duncan <email@hidden>
- Date: Thu, 21 Aug 2008 08:51:46 -0700
On Aug 21, 2008, at 6:56 AM, Tilman Bender wrote:
Is it possible to obtain the angle of rotation from a tranformation-
matrix created with CGAffineTransfrom?
If the CTM consists of only rotation and transform (or if it is scaled
and you know the scale values) then it should be possible to reverse
one. However...
Background:
I am building a simple kitchen-timer app, that should work like the
ones in your mom's kitchen:
You set the time by touching a control and rotating it. Now I would
like to obtain the current
angle of my clock.
I know how to use and create CGAffineTransform stuff, but I am not
really familiar with the extraction of specific information from
such a matrix.
I would highly recommend that you retain the rotation as part of your
data model instead of trying to extract it from the CTM. Not only
that, but if your concatenating lots of rotations to your transform
matrix in order to do the rotation, then your losing precision that
can eventually cause your transform to do very weird things, causing
odd graphical glitches.
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden