iPhone Development

When a company I worked for called Videojax folded I negotiated a MacMini as part of my severance package. So now I can do iPhone development, and why not? Right now I'm teaching myself Objective C and Apple's XCode iOS development platform, particularly the bits of it that do iPhone and iPad development. I was amazed to learn the iPhone has a GPU with OpenGL GLSL compatible shader abilities. On a phone! The iPhone is pretty easy to program, leveraging all of the tools from Mac OS (and from NeXT before that) was a smart move and the whole thing feels mature and smooth. The link between XCode and Interface Builder could be better defined however.

Click the images for short YouTube videos of the projects in action and be sure to hit YouTube's "HD" button so you can see them in all their glory.

Liars DiceLiars Dice For my fist iPhone game I decided to start simple, a dice game called liars dice. Of course I was going to do the dice rolling in true 3D with as accurate a physics simulation as I could muster and a dynamic interface all in wood with sliders, buttons and dials and stuff. See, simple.

Note that in the video the UI isn't complete. Particularly the bar displaying the AI players bid doesn't have it's pretty, rounded wooden overlay so it looks block and ugly.

I found that importing a 3D mesh (the rounded corner die, built in blender) into the iPhone is anything but a simple and well understood process. The simplest way, as of eight months ago, was to use a script that exported the whole thing into a C array structure and then embed it into your application. Primitive, but it worked. Obviously it isn't going to be acceptible for something with many 3D objects.

For physics I decided to try porting the Open Dynamics Engine into iOS, which turned out to be fairly simple and effective. So that's what the physics simulation of the dice is using.

I wanted to leverage my experiences with XNA in building shaders that did dynamic lighting, spectral highlighting, spectral mapping, normal mapping, environment mapping and so on. I quickly learned that many of the bells & whistles available in full fledged HLSL and GLSL aren't available in OpenGL SE, such as a pre-calculated half vector. Because of this I was forced to do much more of the heavy lifting myself, and that was good because I learned considerably more about the details of real-time rendering than I had before. And because of that I was able to optimize out some of the stuff I wasn't using. For example I didn't really need the full half vector calculation to do spectral highlighting, there is a simpler way that looks good enough for a dice game.

Next up: UI completion, shadows, hooking the light up to the compass/gyroscope so it moves as you move your phone, and Game Center integration.

What? Why?

I'm a creative guy, and code is my medium. I'm always wanting to create worlds, games, stories... stuff. To this end I also always want to know how things work and how things can be done better; How does bump mapping work? Is query or object caching better? How do you simulate physics? Is MVC really much better than CGI style page serving? What is Cloud Computing? What's up with iOS?

On these pages are presented a selection of projects seeking to answer these questions that progressed far enough to have demonstrable results. Or, against all odds, were actually completed!

(it's worth noting that these pages are, in themselves, one of those projects)