Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find an iPhone OpenGL ES Example that responds to touch? [closed]

I would like to find an iPhone OpenGL ES Example that responds to touch. Ideally it would meet these requirements:

  • Displays a 3D object in the center of the screen like a cube
  • Maps a texture to the cube surfaces
  • Should move the camera around the cube as you drag your finger
  • Should zoom the camera in and out on the cube by pinching
  • Optionally has a background behind the cube that wraps around the back of the camera.(for example this could create the effect of the cube being in space)

Has anyone seen one or more examples that can do these or at least render the cube with the texture?

like image 784
Jamey McElveen Avatar asked Jun 24 '09 16:06

Jamey McElveen


2 Answers

My iPhone application Molecules has its source code available via a BSD license. It uses OpenGL ES to render a molecular structure, using single touches to rotate the structure, a pinch gesture for zooming, and simultaneous movement of two fingers for panning across the molecule. Unfortunately, it does not yet use textures for any of the rendering it does.

I document some of the things I've learned about OpenGL ES from it here and here.

like image 138
Brad Larson Avatar answered Oct 20 '22 15:10

Brad Larson


Sounds like you're looking for more than one example:

  1. The XCode template "OpenGL ES Application" does this.
  2. This NeHe for iPhone tutorial texture maps a cube.
  3. For this you need the arcball algorithm. Thanks, NeHe.
  4. Why not place your scene inside a texture mapped cylinder?
    Once again, NeHe to the rescue. Does that guy ever sleep!?!

You're welcome!

like image 10
Rhythmic Fistman Avatar answered Oct 20 '22 13:10

Rhythmic Fistman