How to approach a simple animation containing a few pdf images
Hi,
I would like to animate the landing gear of an aeroplane so that I can set various timing parameters for it and download it to some custom hardware that I have. I confused as to how to go about it. The animation is very simple and has gear doors coming down a delay followed by the wheels.
My first approach after reading is to use a custom view and pdf images and try and use the animation proxy? anybody got any better ideas on how to do this?
Adam
I don't know anything core animation - however I believe a book was published about that. It's probably a good idea to get hold of that book. And Apple provide sample applications (with code). Have a look at them and you'll probably get some inspiration and code of course.
There's also a whiz-bang application called QuartComposer: http://developer.apple.com/graphicsimaging/quartz/quartzcomposer.html than enables you to set up pipelines of graphical operations. The nodes in the composer can contain arbitrary JavaScript (and respond to mouse movements, timers and so on). If you have a series of images which represent different states of the gear, your code could be change the visible images in time to produce an animation.
Thanks Robin,
I have ordered two books, one on core animation and the other is the cocoa programming book in the previous post. I have been reading a book on objective C and playing with Quartz composer a little as well.
I'm struggling a little with the frameworks and APPKit graphics vs core animation but have made some sense of it.
I actually need to rotate the wheels by 45 degrees. Currently I have the pdf files in a custom view composited in rectangles and now need to rotate the rectangles or animate them to 45 degrees. This has to be done with the main rectangle graphic on top of the wheels so it looks good. I can't seem to fins a way in the Appkit to rotate a rect? I think I have to use core animation and layers to get what I want which is daunting for a newbie.
I'll keep trying and have another look at quartz composer.
Thanks again
Adam
Apple's Quart Imaging Model is very like Adobe PostScript and that's not a surprise as the genesis of the system was the Next Computer which used Display PostScript. In fact, I believe the NSxxxx classes (or which there are hundreds, NSString, NSOpenPanel and so on) NS = Next Step.
in PostScript, you can paint objects at any location on the 2-d plane by moving and transforming the CTM (current transformation matrix). So in PostScript could draw the gear with something like:
gsave
200 200 moveto45 rotate
.2 .2 scale
drawGear
grestore
You'll find that the syntax in Object/C of course is different, however the operations the same.
By coincidence, another reader of the Forum asked this morning about using NSOpenPanel and I pointed him to the ImageFun application in Aaron Hillegass' book. The coincidence is that I'd like to point you to the same example - however for a totally different reason and that is because he is painting and scaling images in that app. As you've ordered the books, I know you're on your way to enlightenment.
If you'd like to talk you can skype me on 'clanmills'.