Sign in to follow this  

rotating texture coordinates for rectangular quad

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this