PDA

View Full Version : Texture glitch



Pegi18
11-25-2017, 02:18 PM
2559
Goodday, Sorry if this is already answered, could someone tell me what do one call this problem i'm having on that one face. and to what is it related, bad vertice location? Bad texture coordinate values?
I'm using sdl2 with opengl, i've tried a lot of varients of glTexParameter's with no avail. Even trying to keep it simple by just having a plain with 4 vertices, it still seems that half(triangle) is textured. and the cube, 5 of the 6 faces is perfect and then that one side. Without posting all my code and create confusion, just let me know what portion of the code I should post to make resolving easier.

GClements
11-25-2017, 11:28 PM
2559
Goodday, Sorry if this is already answered, could someone tell me what do one call this problem i'm having on that one face. and to what is it related, bad vertice location? Bad texture coordinate values?
The top two vertices have identical texture coordinates.

Pegi18
11-26-2017, 04:31 AM
The top two vertices have identical texture coordinates.

thanks for the reply, but how would I go about fixing something simple as this plane?
v 100.0 100.0 -1000.0
v 100.0 -100.0 -1000.0
v 100.0 -100.0 0.0
v 100.0 100.0 0.0
vt 0.0 0.0
vt 0.0 1.0
vt 1.0 0.0
vt 1.0 1.0
vn -1.0000 0.0000 -0.0000
usemtl None
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
2560

Pegi18
11-26-2017, 01:05 PM
thanks for the reply, but how would I go about fixing something simple as this plane?
v 100.0 100.0 -1000.0
v 100.0 -100.0 -1000.0
v 100.0 -100.0 0.0
v 100.0 100.0 0.0
vt 0.0 0.0
vt 0.0 1.0
vt 1.0 0.0
vt 1.0 1.0
vn -1.0000 0.0000 -0.0000
usemtl None
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
2560

After refering to other code, and debuging for the last 24hours, the problem when adding it to my glList one HAVE to past the texture coordinates FIRST then the vertex then the normals, mine were the same order as the face starting with vertex, texture, normal.:doh: