Well here I am about 6 weeks into developing my first iPhone app based on my generative animation system.

It’s been an enormously steep learning curve, even though coming from a background in Java/Processing, of which I would be fairly proficient.  This has been tough.

I would say I’m at the half way stage now, and after doubting almost daily the project and my ability to realise it, for the first time I feel confident that I can actually pull this off and come up with something half decent on the iPhone.

The direction I’m taking for my first app will be based on the ‘Music is Math’ animation style, semi-abstract, in black and white – roots and vines growing endlessly in real-time.  It will be interactive, respond to touch,orientation etc, have randomising features and maybe a few other tricks.

The last few weeks have been spent mostly focused on creating an optimised real time graphic engine which is perfect for my style of algorithmic animation.  My main concern was trying to reduce the amount of math computation required.  The amount of polygons hasn’t been an issue, which I thought it would be, but the algorithms were killing the CPU and FPS.  My main solution so far was to replace the smallest most stems with bitmaps, which doesn’t affect things visually, and gave me an enormous speed increase.

But then having too many bitmaps became an issue, so I’ve implemented the fasted texturing routines I can muster, which uses PVRTC copmressed images – streamlined image formats best for iPhone, and also mipmapping these, which reduces the efforts needed for the graphic chip to rescale texures at different distances.

I’ve also been using glDrawelements calls to draw all the quads with their bitmaps.  The main body of the ‘snake’ and the first ‘shoots’ that come out are mathematically generated polygon strips created with glDrawarrays.  Other little coding hacks I’ve been using which differ from my original Processing/Java implementation, are things such as disabling depth testing all together, and just drawing my layers in order from back to front.  I’ve also culled backface rendering, disabled all gl lighting, and a few other things.

The demo runs smoothly at 24 fps, it can run a lot faster, but I need headroom to implement the rest of the visuals to be added – to be included next will be the shading/shadow algoritms (more bitmaps), the sprites/particles flying around through a perlin noise field, and also I can hopefully have a duplicate layer of the growing vines in the background, as is common in all my videos to date using this system.

So on we go, I feel inspired again after a tough few weeks.  I want to create something enigmatic, sublime.  Like my mum said when I showed it to her, it’s peaceful to watch, like an aquarium… which is a very good comparison.

But it also has to work, and run smoothly using the technology.  This has been the challenge, not a creative challenge, but technical.

With Zio I hope to create the first of a series of generative animation apps for the iPhone, with Metamorphosis following soon after, culminating with a pyrotechnic audio reactive app.

Spot the Butterfly

June 26, 2009

My video, Metamorphosis, has been screening on a 100ft wall in Oakland, CA, as part of a local arts initiative.

IMGP1725

iPhone Development #2

June 10, 2009

Last month I decided to bite the Apple and start work on my first iPhone app – making the transition from the relative confines of Processing and Java, into the stark reality of C++, Objective C, Cocoa, OpenGL ES and MAC OS-iness. 

Well, I’m 3 weeks in and finally getting somewhere, but not after some duly expected stress.

I’ve managed to get my ‘Zeno’ algorithm up and running, which is the basis of my recent animations using Processing/Java, namely Music Is Math, Metamorphosis, Swan Lake and The Nest That Sailed The Sky.

My first task was teaching myself C++/Objective C, and getting familiar with the Xcode IDE.

 

Downers:-

- writing in Objective C requires more lines of code for almost everything.

- OOP programming much more methodical and less intuitive.

- Basic functions I’ve taken for granted like Perlin Noise I’ve had to implement myself!  Yes I had to actually learn all the math involved to get it working.  Took me a few days to figure out, but it’s time I’d rather not have wasted at this stage.

- Xcode wont allow you to quickly save copies of projects, – to accommodate experimental branching of coding ideas.  It does have a ‘snapshots’ feature, but I don’t really like it.

- Memory management – everything needs to be allocated and released by the programmer, a real pain to learn.

- Programming in OpenGL ES is far from quick and intuitive, lots and lots of code that just sets it up, thankfully I was using pre-made templates.

- generally a VERY steep learning curve for all of the above.

 

Uppers:-

- Xcode is great for debugging, typing in code.

- Objective C generally more dynamic and powerful I think.

- Forces you to think very clearly about management of project, source files and structure of what you’re doing, good in the long run.

- Quicker!

 

So at this stage I’m feeling happier and more confident about realising my first iPhone app.  My plan is to take Metamorphosis and create a real-time/interactive version based exactly on the animation seen in the video.  There’s plenty of work to do yet obviously, there will be a lot of particle,shading effects to be built in, and probably strenuous optimisation.  But I’m looking forward to the task at hand.

Follow

Get every new post delivered to your Inbox.