Jump to content
  • Advertisement
Sign in to follow this  
Butabee

Rotating point based on texture coordinates

This topic is 2854 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

So I'm trying to rotate a point based on texture coordinates but I'm failing to do it correctly.

I want the point to rotate a full circle by the end of the texture coordinates.

Here's what I'm doing...

coords starts at (0,uv.y - 0.5, 0.5)

rotCoords.x = coords.x * cos(uv.x * 8) - coords.z * sin(uv.x * 8);
rotCoords.z = coords.x * sin(uv.x * 8) + coords.z * cos(uv.x * 8);

but the rotation isn't right... it's offset a little bit. I don't know what to multiply the uv.x by.

I got 8 just by trial and error. It seems the closest to what I want, but if someone could help me with the exact math I'd appreciate it, thanks.

Share this post


Link to post
Share on other sites
Advertisement
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!