Basic 2D Texture Howto for iPhone OpenGL ES - iphone

Just started learning OpenGL and couldn't find a decent tutorial to get me going. Specifically, I'm looking for something that will show me how to load an image to an OpenGL texture, store it in a variable to display later, and then draw the image.
I'd appreciate it if someone could write out the basic code to do that for me. If I may ask that you would also separate the code for loading and drawing and also comment thoroughly as to whats going on.
Much obliged

I've been referring to this:
http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html

Check out Apple's ImageProcessing sample.

Related

Are there tutorials or simplified examples for how to use OpenGL texture blur?

I have a UIKit app (no OpenGL included yet) and I need to blur an image in there. Some people suggested to go with OpenGL texture blur for this. There's an sample project from Apple called "GLImageProcessing" but it's such a huge source base and filled with just too much of different stuff.
Maybe someone knows another source that showcases the texture blur on it's own, making it simple to follow the process how to set up an EAGLView that just does that one thing?
You probably want to apply a Gaussian blur effect. Here's a library somebody has provided to do this on a UIImage:
http://code.google.com/p/simple-iphone-image-processing/

Overlay "Structured Glas" Effect on iPhone Camera Feed - General Directions

I'm currently trying to write an app, that would be able to show the effects of glas, as seen through the iPhone Camera.
I'm not talking about simple, uniform glas but glass like this:
Now I already broke this into two problems:
1) Apply some Image Filter to the 2D-frames presented by the iPhone Camera. This has been done and seems possible, e.g. in the app: faceman
2) I need to get the individual lighting properties of a sheet of glas that my client supplies me with. Now basicly, there must be a way to read the information about how the glas distorts ands skews the image. I think It might be somehow possible to make a high-res picture of the plate of glasplate, laid on a checkerboard-image and somehow analyze this.
Now, I'm mostly searching for literature, weblinks on how you guys think I could start at 2. It doesn't need to be exact, in the end I just need something that looks approximately like the sheet of glass I want to show. And I'm don't even know where to search, Physics, Image Filtering or Comupational Photography books.
EDIT: I'm currently thinking, that one easy solution could be bump-mapping the texture on top of the camera-feed, I asked another question on this here.
You need to start with OpenGL. You want to effectively have a texture - similar to the one you've got above - displace the texture below it (the live camera view) to give the impression of depth and distortion. This is a 'non-trivial' problem, in that whilst it's a fairly standard problem in its field if you're coming from a background with no graphics or OpenGL experience you can expect a very steep learning curve.
So in short, the only way you can achieve this realistically on iOS is to use OpenGL, and that should be your starting point. Apple have a few guides on the matter, but you'll be better off looking elsewhere. There are some useful books such as the OpenGL ES 2.0 Programming Guide that can get you off on the right track, but where you start would depend on how comfortable you are with 3D graphics and C.
Just wanted to add that I solved this old answer using the refraction example in the Khronos OpenGl ES SDK.
Wrote a blog-entry with pictures about it :
simulating windows with refraction

Need help on graphic suite of choice for iOS development

I'm trying to play around with ios development and thought of a function that I'd like to achieve but don't yet know where to begin. In short, what I want to do is being able to draw lines with touch and then compare the drawn graphics with another image by pixels. I'm wondering what graphics suite should I use for drawing and comparing image functions? Thanks!
Quartz and Core Graphics are what you will need for pixel processing in iOS. I'm not positive if there are any open frameworks available that try to wrap some of this into friendlier usage, but i haven't used any. Here is a link to the Quartz2d document from Apple: Quartz 2D
As far as touch handling, there are a number of great tutorials to help with this. Try googling iphone touchesBegan.

UIImage animation

Maybe is there a way to do animation only on one image?
So if I have an UIImage and I want to animate it like a wave. Is this possible? And if yes, can you give me some examples or a link to start or something like this? (I used google but didn't find any good start link...)
OpenGL ES is another possibility. Apple provide all the code to set up a rendering context.
From there you just need to get your image into a texture, define some vertices (more than just four), and move each vertex on a sine wave.
Yes - you may want to look into cocos2d - http://www.cocos2d-iphone.org
or OpenGL ES as mentioned above
or Quartz
It all depends on what this 'Wave' effect needs to look like, if it's what i think, you couldn't achieve that by using Core Animation, you would need to look in to these suggestions.

Create lightning in OpenGL ES 1.1

I need to create good looking lightning using OpenGL ES 1.1 (iPhone) and was planning on using shaders. However, when I asked about it in a previous question (OpenGL ES 1.x Shaders) I was informed there that this was probably not an option on the iPhone.
So now I am back at square one, wondering how I might make a lightning animation. It does not need to look ultra-realistic. I have already tried to use things like triangles stripped together. While this method does work, it is not as good as I had hoped it would look.
Does anyone have any ideas on the subject?
Thanks again,
~Eric
Try using a triangle strip textured with a gradient from black to a low-saturation blue or purple, to white. Set your blending to additive (GL_SRC_ALPHA, GL_ONE).
The usual approach is to compute the path of the lightning bolt using a Perlin function, rendering it to a glow buffer, creating a nice looking blur using a Gaussian blur shader and then merge it with your scene.
You could maybe adapt the code from this project. Although it's not ObjC/C, it does use OpenGL.
Here is an article that describes the effect in more detail and provides a VB/DirectX implementation.
Maybe I'm missing something but what's wrong with simply using glLight() and the fixed functionality like everybody else?
Would have to be a very bright light to make it look like lightning and wouldn't you need to shine the light on or through something?