2
$\begingroup$

I need to control the scaling of the mesh with a color ramp so that the effect is smooth like the mesh on the right. I tried different combinations of the nodes in the picture, but nothing worked for me. enter image description here

$\endgroup$
2
  • $\begingroup$ The mesh on the right is smooth only in middle, not on the start and end of the gradient. Have you tried switching "Linear" mode to other options? $\endgroup$ Feb 12 at 20:19
  • $\begingroup$ @MarkusvonBroady It does not have to be exactly the same as on the gradient. The main requirement is that it should be guided by a gradient. $\endgroup$
    – arachnoden
    Feb 12 at 22:26

1 Answer 1

3
$\begingroup$

Scale Elements will separate the Selection, and then separate that by mesh islands, and then scale the islands. So if you don't want the cuboid to be simply scaled as a single object, you need to separate the horizontal edges. Then you need to simply pass the $z$ coordinate to the Color Ramp, but since the ramp expects inputs in range $[0,1]$, all $z$ coordinates below $0$ will read as $0$, and all $z$ coordinates above $1$ will read as $1$ (they will be clamped to the expected range). To combat this I use an Attribute Statistic node, but you could as well e.g. just divide the coordinate by the height of the mesh if it started at zero as in your case… Notice the "Ease" mode…

$\endgroup$
2
  • $\begingroup$ Thank you. But explain to me please, what does node "Not Equal" do? $\endgroup$
    – arachnoden
    Feb 13 at 9:07
  • 1
    $\begingroup$ @arachnoden vertical edges are at an angle of $90°$ to a horizontal vector, so I select edges that aren't at that angle. The Vector $<1, 1, 0>$ was picked, but any vector with $z = 0$ would do as long as both $x$ and $y$ weren't equal (or very close to, due to εpsilon allowing some fuzziness) to $0$ (because an edge parallel to $y$ axis is at $90°$ to $<1, 0, 0>$ and an edge parallel to $x$ axis is at $90°$ to $<0, 1, 0>$, and we want to select those horizontal edges). $\endgroup$ Feb 13 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .