Get Updates By E-mail 

opengl

Tutorial: Texturing 3D Objects In OpenGL ES 2.0

  •  
  •  
  •  
  •  
  •  

OpenGL ES is a topic that I’ve posted about many times on this site, and I’ve been trying to keep a categorized list of OpenGL ES tutorials up to date with every OpenGL ES tutorial I’ve seen.  There have not been too many OpenGL ES 2.0 tutorials to date that go beyond the absolute basics.

Previously I mentioned a good series on OpenGL ES 2.0 that gave a great overview on beginner through advanced topics with some sample code.  I also mentioned a great hands on beginners OpenGL ES 2.0 tutorial from Ray Wenderlich, the creator of the Space Game Starter Kit and co-author of the Learning Cocos2D book,.

Ray has continued on with his tutorial series, and added another tutorial explaining how to texture objects in OpenGL ES 2.0 on iOS devices.  Texturing may sound like something simple, but the process of loading in the textures, and extracting the data from memory makes things somewhat stick on the iPhone and iPad.

You can find the tutorial here:
OpenGL ES 2.0 for iPhone Tutorial Part 2: Textures

Definitely some very handy snippets of code if you ever need to do your own texturing in OpenGL ES 2.0.

Added To The: Categorized OpenGL ES Tutorial Collection


  •  
  •  
  •  
  •  
  •  

iPhone Game Tutorial With Videos – Programming Tutorials

  •  
  •  
  •  
  •  
  •  

Just like to turn you guys on to what is the best iPhone game tutorial with videos on the web so far in case you haven’t seen them.  Please note that this is not the simplest iPhone game programming tutorials as you will be building an OpenGL game engine from scratch.  This does also make this a great iPhone opengl tutorial.

These tutorials are from 71 squared.  They run through the steps to creating a game on the iPhone in tremendous detail, and include source code.  Included are in-depth videos.

Update:  Links no longer valid – sorry to those visiting this page, please see other game tutorials here.

Together These Make One Excellent iPhone Game Tutorial

iPhone Game Programming – Tutorial 1
iPhone Game Programming – Tutorial 2 – Image Class
iPhone Game Programming – Tutorial 3 – SpriteSheet Class
iPhone Game Programming – Tutorial 4 – Bitmap Font Class
iPhone Game Programming – Tutorial 5 – Animation Class
iPhone Game Programming – Tutorial 6 – Tiled Map Class
iPhone Game Programming – Tutorial 7 – Singleton Class
iPhone Game Programming – Tutorial 8 – Particle Emitter
iPhone Game Programming – Tutorial 9 – Sound Manager
iPhone Game Programming – Tutorial 10 – Game Structure
iPhone Game Programming – Tutorial 11 – Joypad
iPhone Game Programming – Tutorial 12 – Saving Game State
iPhone Game Programming – Tutorial 13 – App Store Submission
iPhone Game Programming – Tutorial 14 – Moving To 3D

Update:  Links no longer valid – sorry to those visiting this page, please see other game tutorials here.

 

Now these gents are also writing a book on iPhone game programming.  So absolutely if you like their tutorials I suggest you check it out.  I don’t think it’s available for pre-order yet but you can read some info about it here.


  •  
  •  
  •  
  •  
  •  

iPhone OpenGL ES 3D Collision Detection Tutorials

  •  
  •  
  •  
  •  
  •  

Simon Maurice, has added two new tutorials to his collection of iPhone OpenGL ES Tutorials which I mentioned on my iPhone OpenGL ES resources page.

Tutorials:
1. Collision Detection
2. Collision Detection 2: Moller & Trumbore’s Fast Triangle Ray Intersect

**** Tutorials are currently deactivated they may be back in the future (due to contract issues with the Author and employer).

I haven’t had a chance yet to check these out, but they look fantastic.  Just looking from the pictures I can see that they are damn cool.


  •  
  •  
  •  
  •  
  •  

iPhone OpenGL ES Nehe Lesson #3 Explained

  •  
  •  
  •  
  •  
  •  

In my previous post I added a download link for Nehe Lesson #3 converted to run in iPhone OpenGL ES.

This is an explanation of what’s different in iPhone OpenGL ES when compared to the original version.

In this lesson color was added to the primitive shapes from Nehe Lesson #2, now color must be done differently on the iPhone than on the original version.

In the Nehe OpenGL version of the tutorial color was added through the use of the glColorf function, specifically the lines:

glColor3f(1.0f,0.0f,0.0f);          // Set The Color To Red
glColor3f(0.0f,1.0f,0.0f);          // Set The Color To Green
glColor3f(0.0f,0.0f,1.0f);          // Set The Color To Blue
glColor3f(0.5f,0.5f,1.0f);              // Set The Color To Blue One Time Only

were added into the Lesson with these lines placed immediately after each vertex was drawn using the glVertex3f command, and just before the light blue square on the right was drawn. Now, just like the glVertex3f command the glColor3f command does not exist in OpenGL ES.

Now because these commands are missing, just like the triangle was drawn using vertex arrays, the colors for the triangle are drawn using a color array.

const GLfloat triangleColors[] = {
1.0f,   0.0f,   0.0f,   0.0f,
0.0f,   1.0f,   0.0f,   1.0f,
0.0f,   0.0f,   1.0f,   1.0f
};

Is declared, before using this color array the client state to draw this color array must be changed:

glEnableClientState(GL_COLOR_ARRAY);                    // Enable drawing of colors array

Then when drawing the triangle the command:

glColorPointer(4, GL_FLOAT, 0, triangleColors);         // create an array of colors using Glfloat colors array

is executed. As you can see this lnes up with the vertices used in the color array. After the triangle is drawn we disable the state for drawing color arrays.

glDisableClientState(GL_COLOR_ARRAY);                   // Disable drawing of colors array

Now to make the square on the right blue, and since we are only drawing a solid color we do not need to create a color array but use the glColor4f command. This is similar to the glColor3f function used in the Nehe tutorial only with an added value for alpha. In this case we use:

glColor4f(0.5f,0.5f,1.0f,1.0f);                         // Set color to blue

which causes the square to be blue, and that’s all there is to it. If you have any questions about this tutorial please feel free to post them below.


  •  
  •  
  •  
  •  
  •  

Nehe Tutorial #3 in iPhone OpenGL ES

  •  
  •  
  •  
  •  
  •  

I’ve converted Nehe OpenGL Lesson #3 to iPhone OpenGL ES continuing from my previous post of Nehe Tutorial #2 Converted to iPhone OpenGL ES.

From the small picture you can see this is similar to tutorial #2, the difference being that in this tutorial color has been added.
You can download the tutorial here:
Nehe Tutorial #3 Converted To iPhone OpenGL ES

I’ll be getting into what’s different in my conversion from the original in the next post, for now I’d just like to give an update, as I am trying to put to together a big list of places you can submit your apps to for free PR.

Thanks to Robert Gering creator of the DizzyMission iPhone game for the following:

http://www.apptheater.com
http://toucharcade.com
http://www.iphoneblog.de
http://www.pocketgamer.co.uk
http://www.appcraver.com
http://www.appsundco.de
http://appbeacon.com
http://www.gamestooge.com
http://www.filedownloadfull.com
http://newmobiletech.com
http://www.appstoreapps.com
http://apptester.de
http://www.apptism.com
http://www.fishlabs.net

Looks like the list will be coming together soon, I will keep you updated as I find out about more sites, and turn this into a permanent resource on the site.


  •  
  •  
  •  
  •  
  •