Textures in Opengl ES 2 not working properly

Posted by Adl on Stack Overflow See other posts from Stack Overflow or by Adl
Published on 2010-12-01T12:29:20Z Indexed on 2011/01/13 9:53 UTC
Read the original article Hit count: 277

Filed under:
|
|
|

Hi!

I'm working with Opengl ES 2 on iphone and right now I am trying to get my textures working on my objects. I'm using .obj files and all the data in them are correct. I have written a parser myself to retrieve all data, I convert it to static arrays in C. I discard the material properties for now, only getting the image path from the .mtl files manually.

I have an object with 336 triangles, making this non-trivial to observe, with appertaining vertices, vertex faces and texture coordinates (u,v).

Passing all data into the shaders, the resulting image is this:

http://img530.imageshack.us/img530/9637/pic1io.png

http://img404.imageshack.us/img404/7358/pic2pg.png

But it should look like this (Displaying it in an object viewer). Please ignore the material properties.

http://img16.imageshack.us/img16/1401/pic3cq.png

Using this image as a texture:

http://img217.imageshack.us/img217/1300/shirtdiffuse.png

I'm thinking it might have to do with texture coordinate faces ? It is defined in my .obj file, and I'm not using them at all. In books and tutorials I have not found anything concerning this.

Regards Niclas

© Stack Overflow or respective owner

Related posts about iphone

Related posts about opengl-es