# rotating texture coordinates for rectangular quad

This topic is 4126 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hello, I am drawing a screen aligned rectangle made up of four quads to which I want to apply a sort of explosion/flare texture which I then want to rotate around the centre of the screen. I am just using a single texture and changing the uvs to get my circular effect but I am not quite sure how to go about adjuting these uv to give the illusion of rotation. I was wondering if anyone could point me in the direction of any good examples (diagrams always appreciated :)) - or explain to me - how to do this, I am sure I have seen tutorials on this before* but my google skills seem to have failed me. *In fact I'm sure I recall a diagram somewhat similar to the following : It may be completely irrelevant but I figure if somebody can jog my memory on a way I have looked at before I should catch on quicker!

##### Share on other sites
Is rotating the actual quads not allowed? It seems like you could just do that instead of rotating the uvs. If that isn't going to work, you could use a 2D rotation texture matrix that is setup for the angle of rotation. Something like:

2x4
[ cosAng, -sinAng, 0.0f, 0.0f ]
[ sinAng, cosAng, 0.0f, 0.0f ]

##### Share on other sites
If I rotate the quads surely I will just end up with gaps as the rectabgle will no longer fill the screen properly? As for the rotation matrix I did try that but it didn't seem to give the desired result (don't have the code in front of me at the moment and i can't remember exactly how it looked wrong but it did), I shall go back and double check my working though.

Cheers.

##### Share on other sites
If I were in your shoes, I'd do this...

1. Have a quad that is bigger than the entire screen, but centered on the screen.
2.The quad has a circular texture that covers the screen.
3. Rotate the quad

No additioal maths needed.

- Sid

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 12
• 30
• 9
• 16
• 12