Same vertex different texture coordinates

Hi All,

I’m a bit confusing about loading some of my OBJ files.

I’m programming to OpenGLES 1.1, so I use glDrawElements to render my models.

However, to specify the vertex, normals and texture coordinates I use :

glVertexPointer, glNormalPointer and glTexCoordPointer.

But using this functions, I assume that I need a relation between vertex - normal - texture coordinate, of one to one.

But, some of my models, they have faces that share the same vertex but with different texture coordinates.

IS this normal to happen ? What should I do ? Duplicate the vertex ?

Thanks in Advance,

Victor

Yes, you have to duplicate such vertices.

Hi Xmas,

Thanks for the help.

That is the only way right ?

Or I’m doing something wrong ?

Thanks,

Victor

Yes this is the only way since vertex, texture coordinates, normals,… are indexed with the same index buffer.

Consequently, you have to insert in your vertex array enough vertices for all combinaitions of (vertex, normal, texture coordinates).

Ok

Thanks you all for the help. Understood now :slight_smile: