开发者

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:

Texture floating ponts - problem with rotation

This is how I want it:

Texture floating ponts - problem with rotation


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜