momentum rotation of image

Official forum for the Chipmunk2D Physics Library.
Post Reply
sanjiv
Posts: 3
Joined: Mon Feb 27, 2012 11:13 am
Contact:

momentum rotation of image

Post by sanjiv »

I'm new to iOS graphics and animation and would like to know to how to accomplish the effect of momentum rotation of an image upon flick as seen in the video below.

http://www.youtube.com/watch?v=ZIQs-OWgkgI

Even when not flicked the images have a nice sway. Is this something that can be easily accomplished using Chipmunk Pro.

Thanks.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: momentum rotation of image

Post by slembcke »

Relatively easy yes. You'd really just need to connect a pivot joint to the top of the square and could use the ChipmunkMultiGrab class to help with the touch input.

You can get a trial copy of Chipmunk Pro on the downloads page, and there are a number of examples on the documentation page to try out.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
sanjiv
Posts: 3
Joined: Mon Feb 27, 2012 11:13 am
Contact:

Re: momentum rotation of image

Post by sanjiv »

Thanks for the quick response. I'll start going through the docs and samples. Since I'm still relatively new to iOS development, can you give me a sense of how much value Chipmunk is adding here in implementing this? Would this also be pretty straightforward to implement without third party libraries?

I'm guessing the initial sway is the same functionality as the flick, just that it starts off with a very low velocity, correct?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: momentum rotation of image

Post by slembcke »

It depends on how much you know about physics and vector math I guess. If you just want images that tilt and sway to gravity, that's not to hard. If you just wanted that, I'd say do it without a library. You'd spend more time learning the library than you would just learning the math you need. Implementing the finger flick, you'd need to track the velocity of the flick, figure out how to apply that to the image and do hit detection for the touches on the rotating image. Implementing any one of those things individually isn't too hard, but all together I think they end up being a fair amount of work.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
sanjiv
Posts: 3
Joined: Mon Feb 27, 2012 11:13 am
Contact:

Re: momentum rotation of image

Post by sanjiv »

Great, thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests