The purpose of this blog is to put together a journal of what I've learned trying to draw some 3D on my iOS device. I want to do it mostly for myself as an exercise to remember all this stuff, but I'm also hoping it might help someone in the future.
In the past few months, I've read books about openGL ES, iOS 5 programming, and I also watched the videos of Paul Hegarty's iPhone application development class on iTunes. The problem is the following: There's just not many tutorials out there that blend together openGL ES 2.0, iOS, and GLKit.
I know that this is very platform specific, but not all developers want to have a multi-platform solution written in C or C++. Plus, if you've chosen iOS, then you've probably chosen the easiest platform to get you started working with OpenGL ES 2.0. GLKit is extremely easy to use and does a lot of nasty stuff behind the scenes for you, and provides a math library, a texture loader, and many other goodies.
Even if I do love GLKit and use it as much as I can, there's one thing I try to avoid using, and that would be the use of GLKBaseEffect. GLKBaseEffect is there to mimic what you could do with OpenGL ES 1.x's fixed pipeline, and when you use it exclusively, you don't even have to use shaders explicitly in your code. Shaders are so powerful that you should learn how to use them first when you pick up OpenGL ES 2.0, and that's why I will not even talk about it. If you want to do anything more or less advanced in the future, then you will certainly not want to use GLKBaseEffect.
So here's what I plan to do:
- Use GLKit for texture loading, math, and the view/controller objects
- Use Objective-C as much as I can, even though you will learn to love C with OpenGL
- Choose a simple shape to draw (like a cube!)
- Show some interesting topics like Bump mapping and Scene composition