Sign in to follow this  
Butabee

Rotating point based on texture coordinates

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

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