Wednesday, April 8, 2009

Coming Soon -Another OpenGL Example Ported to iPhone

There's a fairly famous OpenGL tutorial that's been done in many places both online and in books, where you make a flag wave in the breeze. I needed something similar to that a project I'm working on, so I thought a good place to start would be by porting this example to the iPhone. I decided to give the project a little bit of a historical twist:



You can click the image above to see a movie. Unfortunately, because the flag is black, all the shadows I worked so hard to get working right are basically lost, so for practical reasons, this may not have been the best image choice, but you can substitute another if you prefer. I like the historical significance, even if it's not particularly practical.

In case you don't know, the flag above was a famous part of the original Macintosh team back in the early eighties. The actual flag was flown for a short time (unsanctioned by Apple) over the building that housed the Macintosh Division. It was also featured in a picture of the Mac team that ran in Fortune magazine in 1984. A movie of the flag was also hidden as an easter egg on the Install CD that came bundled with two different Quadra Mac models. You can read more about the pirate flag here.

I'll be posting the code for this a little later on. Here's one version of the flag tutorial, and here's another. I won't be doing a full tutorial on this, only talking a little about the iPhone-specific aspects and what I had to change to get it running on our favorite mobile platform.

LOL: I just noticed that my texture mapping must have the x-coordinate reversed. The patch is over the wrong eye! I'll fix that before I post the code.

No comments:

Post a Comment