Jump to content
  • Advertisement
Sign in to follow this  
Funcdoobiest

rotating texture coordinates for rectangular quad

This topic is 3739 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!