1
$\begingroup$

Im moving a large quantity of objects from point A - B by animating their vectors in a loop with animation nodes. I have everything setup how I want it to be. But instead of going from point A to B in a linear path, I want to interpolate the Z axis to add some up and down curvature to the stream of objects path as they move towards point B. This seems like a fairly simple task but I have been stumped for quite some time. All I've been able to do is alter the timing as they continue linearly. Thanks to anyone who can help!

(Apologies for the terrible illustration I only have access to my phone at the moment and can't stop wracking my brain on how to solve the issue)

hopefully helpful illustration

EDIT: I was able to accomplish this on an older version of animation nodes by separating z from the vector, feeding it through a map range node with the interpolation I want, recombining it, and then using it as my start in an animate vector node, but since updating I have not been able to achieve the effect this way. Any similar or alternative methods are appreciated!

$\endgroup$

1 Answer 1

2
$\begingroup$

I'm not using Animation Nodes, but the basic principle is simple: whatever weight w controls how close you're to A, and how far you're to B, result = A*w + B*(1-w), can be passed to some kind of a function like sine to output the Z position: z = sin(w*pi)*max_z.

Below a geometry nodes setup, where I'm using Vector curves for a more arbitrary control than a mathematical function:

Here the aliases for w are % and Fac on the Mix node (that node effectively does the lerping described in the first formula in this post). However, instead of interpolating calculating Z based on %, I'm lerping between Z = -1 and Z = +1, because that's the default Curves horizontal (input) range. This is then translated to a curve with outputs in range [0; 1], and then I multiply the Z component of the vector by 4 to make the effect more visible (range becomes [0; 4]).

$\endgroup$

You must log in to answer this question.

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