Beginner guide to OpenGLES on iPhone - iphone

Does anyone know a good beginners guide to using OpenGLES on the iPhone? I have found some but they all require assumed knowledge which I don't have.

Simon Maurice has some great tutorials on the very first steps. Take a look: http://www.cocoachina.com/wiki/index.php?title=Category%3aSimon_Maurice_iPhone_OpenGL_ES. Do them from the beginning and you'll have a good sense of the basics.
EDIT:
Backup link
Source code

You need only one reference:
http://www.khronos.org/opengles/sdk/1.1/docs/man/
Yeah, some of the documentation doesn't make a lot of sense the first time you read it, but really, read the sentence/paragraph/page again, and again. It really does make sense, and it's very accurate. Which is something you really can't say from tutorials. Tutorials are almost always written by people that don't seem too fussed about leaving out important details while documentation like that is usually written by very nitpicky people that cram every little important fact into (possibly overly-complex) sentences.
Oh, and one golden tip: Add a search function to your browser that does this:
http://www.google.com/search?q=%s+site%3Awww.khronos.org%2Fopengles%2Fsdk%2F1.1%2Fdocs%2Fman%2F&btnI
(replace %s by whatever your browser's search term replacement string is, the above example is for Opera)
I've bound it to the o prefix, so whenever I need to look something up on OpenGL/ES, I just type o glDrawElements in the address bar and instantly get the documentation page on it.

Once again, if I may plug my own work, I have a short writeup on what I learned while writing Molecules for the iPhone. I came into this having no experience with the 3-D side of OpenGL (I had done a little 2-D hardware acceleration before), so I have a bit of a different perspective on the subject. The source code to Molecules is available, so you might be able to learn something from poking around inside it. I also have written a post on how to use Core Animation structures and functions to accelerate OpenGL ES rendering, if you want something a little more technical.
Bill Dudney has a post here about how he started getting into OpenGL ES, and then a follow-on here where he provides code for a Wavefront OBJ loader for the iPhone.
I believe that I've seen a few more good resources around Stack Overflow in various answers, so you might search around and see what else you can find here.

For OpenGL NeHe is a great tutorial. Though, it doesn't specifically cover OpenGLES, it should still be pretty helpful. Just be prepared to run into things now and again that won't work on the iphone.
Also you can get v1.1 if "The Red Book" online.

Simon Maurice's tutorial can be found here

"The Red Book" is not recommended to OpenGL/OpenGLES beginner. It is book for professionals.
The first step is should try to run downloaded simple programs or simple codes from OpenGL web sites.

Here's a good (non-Chinese) link to Simon Maurice's tutorials:
http://web.me.com/smaurice/iPhone_OpenGL_ES_Blog/iPhone_OpenGL/Archive.html
His tutorials are excellent; they're what I used to learn OpenGL ES.

In addition to "The Red Book", another useful book -with tutorials and reference- is OpenGL SuperBible.
Again not OpenGLES specific, but I believe it is useful to learn OpenGL features in general, then filter out the ones you don't need.

Related

What's a good approach studying opengl es 2.0?

I've been messing around with some coding and finally think I'm finally ready for the OpenGL part, then I thought again and decided that I need some guidance with how to learn/ remember OpenGL ES 2.0!
Alright, basically, I know how it works in the high level, then when I begin to type out some code....
I see a bunch of parameters,
I refer to some documents,
I fill in those parameters,
I see some more parameters,
I refer to more documents,
(loop)
MVC comes in,
I get completely and utterly confused!
Brain crashes.
I'm trying to do some simple stuff on the iPhone, I'd like to find the train of thoughts of the gurus, like some sort of check list, or order to do things, so that what I'm doing will always be clear!
Eg, something like:
Arrays of numbers always come before shaders
(some sets of program lines that always appear in a certain order)
Right now, I have a high level understanding of something like this:
http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Chapter-1%3a-The-Graphics-Pipeline.html
What I wish I could know is what are the usual steps involve, if you were to expand all these high level understanding like tags in a website!
I tried reading some tutorials, and I'll be trying again after typing this, to attempt to absorb the common steps/ order to do this, if anyone can help speed up the process, I'll be veeeeeery very grateful! Am I asking too much? =p
I highly recommend this tutorial book for GL on the iPhone
It's particularly useful for fairly experienced developers who are starting with GL. If you are starting at a more beginner level, it may be confusing in parts.

Nice Core-Plot implementations OSX

I am using Core Plot for a little App I am programming at the moment and I was wondering if there are any good looking examples or resources. With good looking I don't mean the google docs Example App ;)
Core Plot includes a number of example apps that demonstrate various features. There is also wiki page on the Core Plot site with links to many apps that use it.
I am not sure that what are you looking for as you have not cleared your question. But i am telling you this link: http://www.johnwordsworth.com/2011/10/adding-charts-to-your-iphone-ipad-app-using-core-plot/ which certainly will help you.

What content have you made/seen made using procedural techniques

I was looking at some study i have to do in the future to do with procedural generation techniques and i was wondering what type of content you have:
Developed
Helped Develop
Seen implemented
Tried to develop
and what methods/techniques/procedures you used to develop it.
If you feel generous maybe you can even go into specifics of it such as data structures ad algorithms you have used to develop it.
If this needs to be put as community wiki because it is not me asking for a problem to be solved just let me know.
This is not a homework thread because it is a research unit that i'm not taking yet ;)
Introversion software, the makers of the games Defcon, Uplink and Darwinia (among others) have started working on a game about a year ago which extensively uses PCG for city generation, here is a video of their work, and you can read more about it on the development diary of the game (start from the first part at the bottom of the page!).
This immediately got me extremely interested, and seeing the potential for games I immediately started researching the technology. I have amassed a folder of 18 PDFs about the subject (research papers, SIGGRAPH presentations, etc). Here, I uploaded it for you.
The main approach is to use L-Systems, however, I never got around to understanding enough of that to make something out of this. I tried other, less successful approaches like using Voronois, recursively splitting a rectangular area into more smaller areas and shifting the boundaries a little to obtain a bit of randomness and polygon division.
The last method I had gotten from Mike's Code Blog's posts (here and here). The screenshots shown on his blog make me drool, it is my biggest programmer's dream to ever get something that looks like that. I emailed him to ask how he did it, and here is the relevant part of his reply, I'm sure he wouldn't mind me posting this here:
L-Systems is definitely one way to go, but that isn't what I'm doing. The basis of my method is polygon subdivision. I start with a simple polygon that represents the entire area of the city. Then, I split it (roughly) in half, and then split those two polygons, etc. until I get down to city-block size. At that point, the edges of all my polygons represent roads. I then use the same subdivision method to break the blocks down into building-size lots.
The devil is in the details, of course, but that is the basic method.
I for one still haven't managed to fully implement a solution of which I'm satisfied of, but it remains one of, if not my single biggest programmer's dream to ever achieve something like this.
Here are a few of the leaders in procedurally generated terrain (and to a lesser extent foliage). If you don't get a detailed answer here regarding methods and techniques, you might want to look in / ask in their forums. I have seen some discussions of techniques there.
TerraGen 2
World Builder
World Machine
Natural Graphics
Noone mentioned the demoscene that ONLY use procedural stuff?
So, go search for Werkkzeug, Kkrieger, MilkyTracker to start. Also you can visit the site pouet and see the wonder of well done procedural videos (yes, procedural videoclips! With music and graphics, all procedural!)
Allegorithmic's products are used in actual shipping titles. These guys focus on texture generation (both offline and at runtime).
They have some very pretty screenshots and demos.

Help me start out with OpenGL

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?
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:
The Red Book
Nehe's game tutorials
There are also some good tutorials specifically for opengl|es and iphone development
Nehe tutorials ported to iphone
Blog-post about 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
Irrlicht opengl engine
Unity
There are probably a million more resources on the web, should get you started though.
Jeff LaMarsh has a good primer on his blog. Here's the TOC:
Basic Concepts. A Look at Simple
Drawing Viewports in Perspective
Let There Be Light.
Living in a Material World
Textures and Texture Mapping
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.
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
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.

Which technologies/concepts do you suggest I learn before creating an iPhone game?

Sorry if this is a broad question, but other than Objective-C, Cocoa, and OpenGL ES, what technologies or concepts would you suggest I read up on before writing a game for the iPhone? I'm a beginning game developer and need all the help I can get :)
MATHS - I would advise this topic
Some example areas of interest for applications in Game Development
Calculus, Geometry,The Cartesian Co-ordinate System, Vectors, Matrices, Transformations etc...
Sorry, my answer is not computing related.
A game tells a story, a great game tells a great story. So I would suggest to learn principles of storytelling.
Not going as scholar as Aristotle's Poetics, I recommend more modern Story by Robert McKee. It focuses on movie making, but I am pretty sure that many of the concepts he develops can be applied to game making.
You should read some articles on GameDev. Obviously, learning some of the fundamental concepts in computer graphics would be very helpful. But really, once you get to where you can write Objective-C and understand the APIs, go ahead and get started. You will learn a lot in the process; of course, keep learning and reading about these things I mentioned, but start coding. Find some books on game programming, particularly AI and so forth. Go ahead and get your feet wet programming though. Of course, be sure you learn your language thoroughly.
Quite frankly, I have found that I never know what I need to know until I actually get my hands dirty. That's why I suggested here that someone looking to jump into designing a 3-D iPhone game start with some simpler, targeted projects. These targeted projects can teach you core concepts as you put them to practical use. OpenGL seemed like this impossible-to-understand black box until I made myself perform some simple tasks with it. In a few weeks, I had an application based on it.
In college, I would spend weeks trying to understand the theory behind an aspect of thermodynamics, but then I would see one practical application for it and the whole thing would fall into place. Since then, I've focused on finding specific applications for concepts before spending too much time with the pure theory behind them.
A solid understanding of what makes a good gaming UI especially on the iPhone would be key, especially with the options it provides, be it accelerometers, or onscreen touch inputs.
I'd be sure to try out existing games and see what works, what doesn't, and what gets good feedback. You may also want to look at Flash and DS based games to see what works on other small screens/devices.