Texture mapping, problems with tex coordinates


i have some problems with texturing a simple cube :D
i think i got the right coordinates already because if i just texture one side of the cube it looks fine, as soon as i try to render two or more sides the texture is stretched as you can see on the pic.

Each face needs its own vertexes so that they can each have their own texture coordinates. It looks like you are reusing 8 vertexes instead of having 24. That’s just a guess, though.

Either that or the texture coordinates on those side faces are messed up.

ahh thx that’s exactly what i did, but do i have to waste all those vertices xD ?? or is there another way?

No… you need them. You could technically trick the texture coordinates by making sure the backside if flipped horizontally and verically, I think… but really you should have separate verts.

Especially if you ever want to have normals and tangents to do lighting and/or bump mapping. Every face will definitely need its own then.