I’ve spent the past two… nay several… days attempting to move my project from Processing to X-Code. There are a number of reasons behind my attempt to abandon Processing.
1) C++ generally is faster than Java.
2) I wanted to try running the app on the iPhone.
2a) It makes sense that for people finding the markers ‘in the wild’ so to speak that they are able to scan them there and then.
2b) A mobile device offers new possibilities for GPS location.
2c) The iPhone is an everyday device for the taking and sharing of photographs.
Having got an app working reasonably well, albeit a bit slowly in Processing, I had hoped it would be relatively simple to convert it to C++. How I underestimated the task.
My first problem is finding a library that will allow me to run the AR detection on the iPhone. I found an OpenFrameworks add-on for the ARToolkit that I had hoped I would be able to use. However, on closer inspection I found that there are problems getting this to run on the iPhone. I have it running on OSX, and to be honest there’s no discernible difference in speed between it and Processing. More annoyingly though, is that it doesn’t support the creation of custom markers. This is a problem.
The ARToolkit comes supplied with 400 different markers, so it’s in no way a lack of choice. However, if I can’t create my own custom markers then whatever markers I use will not bear any relation to the photographs they’re linked to. For me the custom markers are an important part of the project and I’m reluctant to lose them. I did find another version of the Toolkit, which claimed to support custom markers, using Cinder as opposed to OpenFrameworks, but so far I’ve been unable to make the example run properly. Also I’m not sure that would run on the iPhone either.
Following some further Googling I have found a third library, which is actually a C++ version of the library I’ve been using in Processing (NyARToolkit). I’ve not had a chance to try this yet, but it appears to include a lot of the features found in the Processing version so I have my fingers crossed.
Another, perhaps even larger, problem is Flickr. So far I’ve not been able to find an OpenFrameworks add-on to easily access the Flickr API, which surprises me. I’ve found libraries for C and ObjectiveC, the latter being the language iPhone apps should really be written in. Now, theoretically according to the Internet, it is possible to combine ObjectiveC and C++ in the same iPhone program assuming everything is referenced properly. I’ve looked at a few ObjectiveC tutorials and I think I’d be able to make it work.
However, I’m wondering now - is it worth it? How badly do I want this to work on a mobile device? I’ve already spent several days trying to make it work to no avail. How many days am I willing to spend trying to make it work? There are possible ways to make the Processing application run on a mobile device - run it on Android instead of iOS, or use something like Phone Gap to run it across multiple platforms.
I don’t want to end up in a situation where I’m bashing my head against a wall trying to solve technical problems if I don’t have to. I’m far more comfortable with Processing and Java than I am with any of the C languages, therefore I’m more confident in my ability to solve potential problems. In fact I’ve been back to look at my existing app and I’ve already managed to noticeably improve its speed by re-ordering portions of the code.
If it comes right down to it, I’d rather that the piece works well on a computer than poorly on a mobile device. There are other problems to solve other than technical ones, which frankly I suspect are more worthy of my time.