11
$\begingroup$

Is it possible to align procedural wave texture in Cycles perfectly - say - vertically? Because when assigned to an object (in node editor), it's rotated ~45° or so... I tried playing with mapping, but it's never perfect...

Sphere; loc, rot, scale applied; not unwrapped:

default

Node setup:

node setup

$\endgroup$
8
$\begingroup$

I managed to do this with this peculiar set of angles on the mapping node:

enter image description here

Rotations: X: 35d Y: 45d Z: 90d

$\endgroup$
  • $\begingroup$ Weird... Looks like the default values are not totally random, but why those strange angles then? Isn't this a bug? :P $\endgroup$ – Selrond Dec 17 '15 at 21:35
  • 1
    $\begingroup$ Answering this requires delving into the source, for which the hours is much too late :-P Not sure you can call this a bug, but it's certainly not a feature! $\endgroup$ – TLousky Dec 17 '15 at 21:37
7
$\begingroup$

Ok, I'm years late to the party, but the reason the texture is rotated is because it's applying the mapping using the X, Y, and Z coordinates equally. If you want to constrain it to a single axis, you can just use a "SeparateXYZ" node followed by a "CombineXYZ" node and only use the axes you want. For example, as gandalf3 pointed out, if you want the texture aligned along the Z-axis, simply connect the Z output of the SeparateXYZ node to the Z input of the CombineXYZ node.

Z-coordinate only

Likewise, if you want it to follow the X-axis, connect only the X output to the X input. If you choose both Y and Z, your texture will be at a 45-degree angle because it's affected half by the Y coordinate, and half by the Z. You can also think of it bisecting the axes you use.

Y-and-Z coords

That's why when you use X, Y, and Z all at once, it points at exactly the center between the X, Y, and Z axes. You might think that's 45 degrees from each axis, but it's not. Since the rotations are applied on top of each other, you get the "weird" values of 35, 45, and 90 degrees (look up Euler angles if you want more info). It's not a mystery once you understand the math (or at least how the math works).

$\endgroup$
  • $\begingroup$ Thank you for both your answer and your time, however I don't have time to test it. As soon as some people prove it's the right answer, I'll mark it accordingly :) $\endgroup$ – Selrond Jun 22 '17 at 10:19
5
$\begingroup$

I'm not sure why, but it appears the wave texture adds the X and Y components of its input coordinates. You can easily correct it feeding it coordinates with the X and Y subtracted:

enter image description here

$\endgroup$

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.