How to transform uv to radial shape

I’m looking for a way to take world position coordinates masked to R & G (x,y) and feed it into the custom uvs property so it makes a texture sample near zero width at the top and wrap into itself at 360 degrees. I’ve been scratching my head for awhile. I’m stuck on the idea that y is probably distance of x,y to origin, and x is multiplied by the distance but everything I try is a mess.

In essence

becomes

130513-conicalgradient_gradient1.png

in trigonometry, this problem is known as “converting from Cartesian to polar coordinates”

https://www.mathsisfun.com/polar-cartesian-coordinates.html

Thanks! That’s awesome, I had a feeling the x^2+y^2 = r^2 circle formula would be in it but I couldn’t derive the whole thing myself. Also another case of not knowing the right search terms.

For anyone landing on this question in 2023, there’s a built-in node for this called the VectorToRadialValue. Drop that into your material, grab the radial coordinates and connect that to your texture map and you’re set.

2 Likes

2024 update - the built in node VectorToRadialValue works, but it gives a nasty seam on the side.

I found a better solution in another forum post here - Polar Coordinate Material Function - #11 by simonschreibt

I copied the graph from the image posted there and I get a seamless radial material.