XNA Rotate Texture 2D

前端 未结 3 761
灰色年华
灰色年华 2021-01-18 13:44

I\'d like to rotate a Texture in XNA. I know I can rotate it when it is drawn, but I would like the Texture2D variable to be the rotated texture. Is there any way to do this

3条回答
  •  孤独总比滥情好
    2021-01-18 14:12

    One way would be to pass a rotation matrix to your shader and multiply your texcoords by that before calling the texture sampler.

    I'm not sure if XNA/DirectX has the same concept as OpenGL's texture matrix.

提交回复
热议问题