Texture floating ponts - problem with rotation
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.开发者_C百科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:
This is how I want it:
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.
精彩评论