Re: CAKeyframeAnimation for 'position' not working
Re: CAKeyframeAnimation for 'position' not working
- Subject: Re: CAKeyframeAnimation for 'position' not working
- From: Christopher J Kemsley <email@hidden>
- Date: Thu, 1 Oct 2009 15:13:50 -0700
Hmmm OK, so I modified it, though it still fails.
The values it's now using are:
2009-10-01 15:08:59.508 Whose Line[56978:207] <CAKeyframeAnimation:
0x3910370>
2009-10-01 15:08:59.508 Whose Line[56978:207] --> 11, 11
2009-10-01 15:08:59.509 Whose Line[56978:207] --> position
2009-10-01 15:08:59.514 Whose Line[56978:207] --> (
0,
0.09548751,
0.103747,
0.2838437,
0.469581,
0.6641821,
0.7078969,
0.8426672,
0.9174054,
0.9943594,
1
)
2009-10-01 15:08:59.515 Whose Line[56978:207] --> (
NSPoint: {126, 305},
NSPoint: {163, 310},
NSPoint: {286, 313},
NSPoint: {3, 172},
NSPoint: {379, 182},
NSPoint: {443, 305},
NSPoint: {447, 308},
NSPoint: {433, 16},
NSPoint: {465, 207},
NSPoint: {399, 49},
NSPoint: {353, -12}
)
So... It's producing values normalized between 0 and 1, with the first
and last object being set as exactly 0 and 1, but still nothing
happens...
On 1 Oct 2009, at 3:05 PM, David Duncan wrote:
On Oct 1, 2009, at 2:45 PM, Christopher J Kemsley wrote:
The output, from the print statements, to show that it has VALID
values, is:
2009-10-01 13:11:00.887 Whose Line[56132:207] <CAKeyframeAnimation:
0x3921510>
2009-10-01 13:11:00.888 Whose Line[56132:207] --> 11, 11
2009-10-01 13:11:00.888 Whose Line[56132:207] --> (
0.178501,
0.4809336,
0.5841551,
0.8514135,
0.9723865,
1.163051,
1.258054,
1.540105,
1.850756,
1.916502,
2
)
The timings look right - the duration was set to 2 seconds... So
they're all in order and randomly spaced.
I'm not certain if anything was printed to the console, but these
timings are incorrect. From the documentation on CAKeyFrameAnimation:
"Each value in the array is a floating point number between 0.0 and
1.0 and corresponds to one element in the values array. Each element
in the keyTimes array defines the duration of the corresponding
keyframe value as a fraction of the total duration of the animation.
Each element value must be greater than, or equal to, the previous
value.
• If the calculationMode is set to kCAAnimationLinear, the first
value in the array must be 0.0 and the last value must be 1.0.
Values are interpolated between the specified keytimes."
So your values are ascending, but they are not normalized to 0-1,
and for linear the first value is not 0.0.
--
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