Convert an UIImage in a texture

I haven’t test the following but i will decompose the conversion in 3 steps: Extract info for your image: UIImage* image = [UIImage imageNamed:@”imageToApplyAsATexture.png”]; CGImageRef imageRef = [image CGImage]; int width = CGImageGetWidth(imageRef); int height = CGImageGetHeight(imageRef); Allocate a textureData with the above properties: GLubyte* textureData = (GLubyte *)malloc(width * height * 4); // if … Read more

Gaussian filter with OpenGL Shaders

A highly optimized shader-based approach for performing a nine-hit Gaussian blur was presented by Daniel Rákos. His process uses the underlying interpolation provided by texture filtering in hardware to perform a nine-hit filter using only five texture reads per pass. This is also split into separate horizontal and vertical passes to further reduce the number … Read more

Is it possible to rotate an object around its own axis and not around the base coordinate’s axis?

First thing you should know is that in OpenGL, transformation matrices are multiplied from right. What does it mean? It means that the last transformation you write gets applied to the object first. So let’s look at your code: gl.glScalef(0.8f, 0.8f, 0.8f); gl.glTranslatef(0.0f, 0.0f, -z); gl.glRotatef(xrot, 1.0f, 0.0f, 0.0f); //X gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f); //Y … Read more