Search code examples
iphoneipadopengl-escore-animation

How can I make a 3-D cube from 6 images in my iPhone application?


I'm new to iPhone programming. I have 6 PNGs that represent all sides of my classroom from the inside. I would like to make them into a single 3-D cube that you would view from the inside, with the ability to look around this cube by moving your finger.

How would I go about implementing something like this? I found Core Animation's CATransform3D and a little about textures in OpenGL, but I'm not sure what to use for my case.


Solution

  • You're looking for something called a Skybox. The coding for this is well understood and you shouldn't have any difficulty finding example OpenGL code to use. Here is as good a place to start as any, but just Google 'OpenGL Skybox' for lots of examples.