7
$\begingroup$

I want to distort a 3D texture around the Z axis in Cycles. I found here that you can convert cartesian texture coortinates to polar coordinates but the problem is that you end up with a projected 2D texture. I want to preserve all the 3 dimensions and stretch or squash the texture around the Z axis to get a behavior like this :

enter image description here

...but with 3D texture coordinates.

Can we achieve that with Cycles nodes ?

$\endgroup$
  • $\begingroup$ you want to scale a texture around the Z axis, or do you want to create the effect shown on the bottom image, or is the texture intended to control the distortion of the objects? $\endgroup$ – Firewill Jul 3 '17 at 1:51
  • $\begingroup$ I want to scale the texture around the Z axis which would give the effect on the bottom image except not with meshes but instead a 3D texture (like noise or voronoi). So if I were to use volume scattering I would get the same behavior. Of course there would be a half plane in which the texture would disappear as I would scale it down which would create a seam, just like for the Cartesian to Polar coordinates conversion. $\endgroup$ – ChameleonScales Jul 3 '17 at 2:14
  • $\begingroup$ I swear I did this by accident yesterday answering another question. Trying to find it. $\endgroup$ – Firewill Jul 3 '17 at 2:31
  • $\begingroup$ Please find it back ! $\endgroup$ – ChameleonScales Jul 3 '17 at 2:45
  • $\begingroup$ Sorry, not sure what did it, I know I was messing with the scale, mapping node, separating the XYZ and some math nodes in between, I saw that effect and tought that it looked neat, and then went on because what I was lookign for had nothing to do with that. Also it probably wasn't a clean answer either, because I suspect the real answer is probably much more complex, Im going to give it a whirl, but I think this might be above my possibilities. $\endgroup$ – Firewill Jul 3 '17 at 2:57
9
$\begingroup$

Found it. The idea is to use a gradient node in radial mode and plug it to the angle of a rotation node (just like a Mapping node but with an input socket for the rotation). Since such a node doesn't exist in Blender we make it with math nodes.

First the rotation node itself (it's a node group) :

Blender rotation node group

then the general setup (the green node is the rotation we made above and the yellow node is the one to animate (the second value in the Multiply node) :

distort 3D texture around Z axis node setup

Result :

distort 3D texture around Z axis

Here is the file :

$\endgroup$
  • 4
    $\begingroup$ Why put in an answer that says "I found a solution and I am currently making this reply that I will edit..."? Just write your answer, then post it. $\endgroup$ – David Jul 5 '17 at 12:54
  • $\begingroup$ no kidding it was simple >.< great solution, looks really fun! $\endgroup$ – Firewill Jul 5 '17 at 21:03
2
$\begingroup$

radial coordinates Just for illustration of what I PM earlier..

$\endgroup$
  • $\begingroup$ this solution is also great, tough I don't understand the math behind it, super elegant! $\endgroup$ – Firewill Jul 5 '17 at 21:02
  • $\begingroup$ yes but the result is not as clean towards the center (the texture converges to it). You can see it when looking from the top. $\endgroup$ – ChameleonScales Jul 5 '17 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.