Monday, August 10, 2009

OpenGL ES Update

I know there's probably one or two people out there who would like to see another entry in the OpenGL ES from the Ground Up series.

The good news is, I started one a while back, right after WWDC. It's a fairly extensive introduction to OpenGL ES 2.0 and shaders.

The bad news is, I have no idea when I'll have time to finish it. I'm behind on writing the next book, plus I'm frantically trying to get ready for the iPhone Boot Camp NYC this weekend (boy, that snuck up on me). I will finish it at some point, though.


Zoe said...

Hi Jeff

I love your tutorials and your books.

Before you get stuck into ES2.0, I was wondering if you would consider taking a vote from me - and an 'on my knees beg' for assistance and a tutorial that I don't think has really ever been done before.

'A complete look at 'World / Screen Coordinates for a 2D game'

The reason I'm asking this is that in all my (expensive and extensive) collection of OpenGL books and online stuff, nobody ever really explains this stuff.

I mean, say I'm doing an iPhone 2D game, and the screen as a whole represents about 133m wide and 200 high. I have to draw my objects in a size measured in 'meters' and I also have to do all my onscreen buttons etc...preferrably without changing the glOrthof so that I can avoid OGL state changes.

So one pixel = x meters...

How do I use this? How does this affect my Euler integration for simple ballistic physics etc...

Please. Could you help?



ScottYelich said...

I'm anxiously waiting. Until then, I'll run through the current list again :-)

Thanks for the great blog!


David said...

All the best for the bootcamp. I wish I could be there!

I'm sure you get lots of requests for suggestions on things to write and that you have a very large queue. I have enjoyed working the WaveFrontLoader as I start my journey with OpenGL. In the last couple of evenings I've tried to add in a onscreen display for a FrameRate counter... seemed like a good idea at the time... A friend pointed me in the direction of Texture2D.m - everything runs ok except for the lack of a onscreen framerate counter display.

I like the articles/tutorials. They are easy to read and understand. I must get back to "the matrix"! - haven't picked it up again yet.

Thank you.

Jeff LaMarche said...


Before? I'm already stuck in OpenGL ES 2.0, and in writing More iPhone Development, and in preparing for a 3-day workshop. :)

I'll have to give it some thought. It's not a problem I've ever really thought about, so I'm not sure I could say anything useful without quite a bit of research and experimentation.

My gut reaction would be to just stick with glOrtho(), but set a zNear and zFar so that your stuff is actually happening in 3D space, then you could just use 3D calculations rather than translating.


That's not an easy task. I actually started a tutorial on that a while back, but got sidetracked.

The trick is the projection view matrix - You have to draw the HUD in orthographic mode, which means you have to tweak your projection view matrix so that it basically looks like it would if you had called glOrthof() instead of glFrustum(), but only before you draw the HUD, and then you need to restore the projection view matrix when you're done drawing the HUD.

Unfortunately, I don't have a working code sample to show you, but it is on my list of future posts.


Brian said...

Thanks for the Ground up series.
If you wrote an iPhone Open GL ES book I would buy that in a heart beat.

Jeff LaMarche said...


I will make an announcement when it is published, but I recruited the person who helps me out when I'm stuck on OpenGL problems to write a book on OpenGL ES for the iPhone for Apress.

I don't think an OpenGL ES book is in the cards for me anytime soon. I've been approached by another publisher (not Apress) about writing one, but I turned them down. I really wouldn't feel right writing one after recruiting somebody else to do a book on the same topic for Apress.


Edwin said...

scrub m65 kamagra attorney lawyer body scrub field jacket lovegra marijuana attorney injury lawyer