Re: Need smooth animation suggestions
Re: Need smooth animation suggestions
- Subject: Re: Need smooth animation suggestions
- From: Ethan John <email@hidden>
- Date: Tue, 2 Mar 2004 08:51:02 -0800
You can set up Animation and AnimationController classes to encapsulate
this behavior and hide it from the end user. Have the
AnimationController class check the timer, and only draw its Animations
at correct intervals.
This would make it easy to test various timer implementations.
On Mar 1, 2004, at 11:18 PM, Daniel Todd Currie wrote:
One thing that might help would be keying your animation off the clock
time. An NSTimer will not give you truly precise timings, since it is
dependent on the run loop. Instead, whenever the timer fires and your
animation method begins, read the clock time and extrapolate your
animation values from from the exact millisecond time.
Other than that, the quality of your animation will be dependent on
system performance and refresh rate, which you could also try
increasing if system performance is not an issue. Check
http://cocoa.mamasam.com/ for a post that Chris Hanson sent to me a
few months ago regarding this topic.
-- Daniel Currie
On 2004 Mar 01, at 22:28, Larry Wilson wrote:
What is the recommended way to achieve smooth animation on Cocoa?
I've
tried using an NSTimer (set to fire at apx 30 fps) and notifications,
but I'm getting a bit of stutter in the drawing - particularly if I
move another application window (the animation momentarily stops or
slows).
I'm currently performing a [NSView compositeToPoint:aPoint
fromRect:aFrame operation:NSCompositeSourceOver] from an offscreen
buffer, and then setting [self setNeedsDisplay:YES];
Any suggestions?
Thanks.
-Larry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
ethan john
http://students.washington.edu/thaen/
Apple Campus Representative
University of Washington
206.841.4157
I've got a fever and the only cure is more cowbell.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.