java – Texture floating ponts – problem with rotation – Education Career Blog

I have a texture in my Square. The problem is when I assign floating texture points the image gets rotated 45 degrees at right. I want it without the rotation.

The current texture points:

texture = new float{
0.0f, 0.0f,
0.0f, 1.0f,
1.0f, 0.0f,
1.0f, 1.0f,
};

Any ideas? Thanks in advance!

This is how it ends:

alt text

This is how I want it:

alt text

,

I think you want:

texture = new float{
0.0f, 0.0f,
0.0f, 1.0f,
1.0f, 1.0f,
1.0f, 0.0f,
};

i.e. swapping the third and fourth entries.

Edit:
Should be:

texture = new float{
0.0f, 1.0f,
1.0f, 1.0f,
0.0f, 0.0f,
1.0f, 0.0f,
};

,

This is OpenGL right? There could be several reasons… please post some code. Firstly are you sure your projection is set up correctly?

Secondly, check that your texture co-ords correctly correspond to your vertex coords.

Leave a Comment