# OpenGL ES texture rendered not as expected with disproportional aspect ratio triangles

I cannot seem to understand how texture coordinates work. I try to render a texture into two triangles and this is what I get

Where the expected output is a normal continuous image as you can imagine.

Triangles coordinates (where w = 1080, h = 1920):

0, 0, w, 0, 0, h,
w, 0, 0, h, w, h


Texture coordinates

0, 1, 1, 1, 0, 0,
1, 1, 1, 0, 0, 0


Texture parameters

gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);

gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);

gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

• The fact that the moon/planet doesn't look spherical to me seems to suggest that you might have perspective correct texturing turned on but haven't set the "W" (and I don't mean your width value) set correctly. – Simon F Jun 7 '18 at 10:40
• @SimonF updated the question adding used texture parameters. I tried using REPEAT instead of CLAMP_TO_EDGE but this hasn't changed the output. – Yaroslav Mytkalyk Jun 7 '18 at 11:40

Take a piece of paper and draw your 2 triangles vertices coords and uv coords. They seem to be misplaced (e.g. 0,h corresponds one time to 0,0 and other time to 1,0)
• Thanks, your answer made me think in a right direction and google the UV picture again. Now I get it. The correct sequence for my scenario is 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0. – Yaroslav Mytkalyk Jun 7 '18 at 17:59