views:

36

answers:

2

Can anyone kindly put me on the right path as to how to go about animating an object as though it's being rotated by touch+drag? We took images of an object sitting on a rotating tray at 10-degree intervals.

I was tinkering with Titanium and had a demo running whereby I simply changed the image to the next (or previous) image in an array depending on which way I caught the swipeLeft or swipeRight. It's not beautiful, but it worked in the simulator. Once I put it on the iPad it ran slow and crashed.

I've switched to Xcode and I've been in the throes of learning Cocoa/Cocoa Touch. I'm just wondering if I'm on the right path by replacing the image in the UIImageView as I catch drag events or if I should make two animations that play corresponding to the direction of the drag, or if I should be looking at an entirely different approach, such as OpenGL, though that doesn't seem right.

Thank you very much for any help!

A: 

Replacing the image on the UIImageView should be enough (that would be my first idea). The problem you may be facing boils down to the speed. Once the images are loaded, the corresponding animation should be fast (assuming you will not load the same images twice).

I wouldn't write an OpenGL applicaton for this. It seems like an overkill.

Don't know about the ipad (I know it's faster than the iphone) but iphone liked PNG images. Those load faster than others.

krzyspmac
A: 

If you had the 3d object mesh, would it be faster to load the 3d object directly, or to render it into 360 frames of .png (1 per angle, assuming a certain set azimuth)?

ina