0
$\begingroup$

I can't find any documentation or article about it on the internet different from the information provided on the manual page. For me, Blender's documentation is not clear on what mathematical method is used to displace a mesh with the cast modifier. If anyone understands how to work this modifier, any help would be greatly appreciated. Thank you!

$\endgroup$
2
  • $\begingroup$ I do not figure out how to answer such a question without digging into the source code itself... $\endgroup$ Commented Feb 26 at 10:52
  • $\begingroup$ Please provide some background on why you need this. en.wikipedia.org/wiki/XY_problem $\endgroup$ Commented Feb 26 at 11:24

1 Answer 1

3
$\begingroup$

I think the algorithm isn't all that hard to understand. For example, casting to sphere is normalizing all positions, and the "Factor" defines the linear interpolation between the two:

This geonodes setup controls left monkey, the purple field is driven by the cast modifier, which controls the right monkey:

Normalizing the vector is dividing its components by the length of the vector.

Scaling the vector is multiplying its components by the "Scale" which here is the average length of all vectors. Some "Cast" modifier properties allow you to override this size.

"Mix" node pairs the $xyz$ components of two vectors, and for each pair calculates the outcome with a lerping formula: $(1-t)A + tB$, where $t$ is the "Factor".

There's a lot of little subtelties of the algorithm, like the mentioned size, or limiting the effect to an axis (lerp only on chosen axes), or instead of casting to a sphere you could cast to a cube, which I think works as if by shooting a ray from origin in the direction of the current position and the result is the position of the ray hitting a bounding box of the input geometry. Of course this can, and probably is in the algorithm, calculated mathematically - an intersection of the ray and the bounding box (axis-aligned cuboid).

$\endgroup$
1
  • $\begingroup$ A Clamp will do for the Cube, maybe? (If necessary preceded by a scale) $\endgroup$
    – Robin Betts
    Commented Feb 26 at 12:12

You must log in to answer this question.

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