3

Till today I am working with Basic UIKIT application but now onwards I need to work in OpenGL.

Problem is I have not any idea about OpenGL and am confused lot about how to start and from where to start.

I need to create an application which is same as "iBeer" (see movie in YouTube).

So I am having lots of confusion about how do I create graphics of beer that you seen in application, so what should be preferred library?

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 2
    This is very similar to this question: http://stackoverflow.com/questions/885152/how-to-make-iphone-apps-like-ibeer-imilk-ibug-ibeer – Brad Larson Jun 01 '09 at 12:26

5 Answers5

7

Creating opengl applications is kinda time consuming, it takes time to learn the syntax and get comfortable with.It's not easy to just magically write an "ibeer"-app, even if it's not the most advanced application ever written.
I don't think there are any shortcuts, you will have to learn opengl and its syntax.
iphone also uses Opengl|Es which syntax is not to far away from regular opengl, but still differs enough that you can't use regular opengl-engines.

The two best opengl resources i have encountered are:

There are also some good tutorials specifically for opengl|es and iphone development

However i'm gonna guess that you are more interested in creating the application than learning opengl syntax, therefore you should also take a look at some opengl-engines

There are probably a million more resources on the web, should get you started though.

Silfverstrom
  • 28,292
  • 6
  • 45
  • 57
3

Jeff LaMarsh has a good primer on his blog. Here's the TOC:

  1. Basic Concepts. A Look at Simple
  2. Drawing Viewports in Perspective
  3. Let There Be Light.
  4. Living in a Material World
  5. Textures and Texture Mapping
Rog
  • 17,070
  • 9
  • 50
  • 73
1

Learning OpenGL and/or OpenGL ES is done best by learning the prerequisite concept of Computer Graphics in general, as well as learning the mathematics involved. Specifically linear algebra, vector spaces and how matrices can be used to represent coordination systems. OpenGL is just an API which is easy to use, as long as you understand what you're doing. If you're afraid of math, don't waste your time.

For absolute beginners, I recommend the book "3D Math Primer", with errata and samples on gamemath.com and an online article named "The matrix and quaternion FAQ" available here: www.j3d.org/matrix_faq/matrfaq_latest.html

And the OpenGL ES 1.x specification for implementation used on the iPhone: http://www.khronos.org/opengles/1_X And last but not the least, the specification for OpenGL 2.1 and the first version of the OpenGL Shading Language, GLSL: http://www.opengl.org/registry/doc/glspec21.20061201.pdf http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.10.59.pdf

A lot of people I've spoken to don't think the specification counts as documentation for library users, but in my opinion it does; simply because it is accurate, it has has authority and any other publications would be just citing it anyway. If you understand the mathematics required and the general concepts of Computer Graphics, reading the standard should be a breeze.

Last word: Avoid NeHe at all costs. I saw it suggested here, and it's probably okay if you want to go the try-and-fail route. NeHe's tutorials teaches how, but not why. Most of the examples are also horribly outdated.

I recommend focusing on the programmable pipline of OpenGL (shaders) instead of the fixed-function pipeline, if you want to use OpenGL on a computer. (OpenGL ES 1.x does not have shaders) Shader languages like Cg, GLSL and HLSL are here to stay. The proof for that is the latest OpenGL 3.1 standard where the only way to get things done is through shaders. Just a wise warning, as The RedBook and other "Tech yourself OpenGL in 10 days" books tend to focus on the latter.

1

I would suggest taking the other technologies out of the equation and learning OpenGL separately: then look at the differences in ES and introduce the iPhone specifics, etc. I would second Mads that NeHe is a bad place to start: There are some mistakes in those tutorials that have gone unaddressed (such as forgetting that OpenGL's y-coordinate is inverted relative to most UI toolkits but also forgetting that BMPs are stored upside-down relative to UI toolkits, so loading a BMP and displaying it works through coincidence rather than by intention).

The OpenGL red book suggested above is hands down one of the clearest and best written computing books I have ever read, but the free online copy is out of date so grab a modern dead-tree copy. You won't regret it. Again I agree with Mads that a good understanding of the maths is important. I think you could touch up your maths in parallel with reading the red book as it breaks you in gently and has some appendices covering some of the tricks.

Finally when trying out different things, like the impact of translations, scaling, etc., you often find yourself in a compile,tweak,compile loop. Much more effective is to have an app that lets you tweak parameters at run-time: but writing such a thing whilst learning is a bit of a steep ask. Nate Robins has some excellent demonstration programs that let you tweak parameters to opengl calls and show you the impact right there in the app. They come highly recommended by the opengl red book itself : http://www.xmission.com/~nate/opengl.html

jmtd
  • 1,223
  • 9
  • 11
0

I found this book quite useful for learning OpenGL ES 1.1 (the version the iphone supports): http://www.amazon.co.uk/Mobile-3D-Graphics-Kaufmann-Computer/dp/0123737273/ref=sr_1_3?ie=UTF8&s=books

Although I already knew the basics of OpenGl before reading it, so can't vouch for how good it is for a total beginner.

Other people seem to like the "Redbook", a free online version is available here: http://www.opengl.org/documentation/red_book/ This might be useful for learning the basic principles, but it covers standard desktop openGL, and there are differences between that and what is available on the Iphone.

There are also a couple of examples that come with the Iphone SDK, which I found very useful.

Tom Jefferys
  • 13,090
  • 2
  • 35
  • 36