1
$\begingroup$

Any idea how can effect like this can be done with Animation Nodes:

EXAMPLE CLIP

Is this done with particles? How do I make them to change directions with timing. Or how do I use the vectors? I used initial position change method as per Docs, but I'm still not able to change the direction. I was thinking adding another vector list, the vector which would be followed by the original one. But didn't figure out how to make it follow another one. Or how to use Rotation to Direction? I know im missing something, but just can not figure it out. Much appreciate your assistance in advance. Cheers, David

$\endgroup$

3 Answers 3

5
$\begingroup$

This effect can be achieved by creating a random walk using a loop as you suggested. It is important to make sure the random walk satisfy certain conditions:

  1. The step direction has to be parallel to one of the three fundamental axis, or else the perpendicularity of the network won't be achieved. This is achieved by defining the step as a unit vector with two zeros components.

  2. Each step should not be parallel to the previous step, or else the network will have edges of non uniform length and overlapping edges. This is achieved by making sure the non zero component of the step vector is not the same as the previous step, that is, a different component should be the non zero.

The implementation is rather advanced, so it might not make much sense for novice. First, we add a vector parameter representing the starting point of the random walk, at each iteration, this parameter is reassigned to itself plus the step vector. Then, we add a constant integer list parameter Range containing (0, 1, 2), those integers represent the possible indices of the component that will have a non zero value. An integer parameter Last Axis that represents the index of the component that was non zero in the previous iteration is added and reassigned to the index of the non zero component chosen at the current iteration. The index of the non zero component is chosen randomly from the Range list after removing the Last Axis integer from it. We now know which component will have a nonzero value, to construct such vector, we add a constant float list parameter filled with three zeros (0, 0, 0) and set the component of the chosen index to one or negative one based on the sign of a signed random number. Then this float list is converted to a vector generating the required step vector. The seed of the random generators shall be equal to an input integer parameter multiplied by the number of iterations plus the index of the current iteration, making sure the seed is unique for every input integer for every iteration. Note that the zeros and range lists have to enforce copying because they are mutable object that are being edited multiple times. So, the node tree becomes as follows:

Node Tree

Another loop is constructed to generate multiple splines based on multiple random walkers. A random starting point is chosen per iteration:

Node Tree

Lastly, the output splines are trimmed to have the animation effect:

Result

$\endgroup$
0
1
$\begingroup$

So I got it working with this node network. This is for just only one line. Unfortunately I could not make it work to grow from the matrix or other locations, so I just manually duplicated them :) This solution is mainly based on info provided in the docs. Hope it helps. If anyone will have a solution on how to distribute them with different seeds from different positions, would be great to hear. Thanx again.

Note Network

$\endgroup$
0
$\begingroup$

Omar's solution is great! For me its was just bit too math thinking. I get it, it is elegant and clean. But I struggled to get it. So I just tried to get it done as per my way of thought process. These are the nodes. I'm sure its not the same, but it is quite close. Omar, your insight will be very valuable! Please comment.

PICTURE 01

PICTURE 02

PICTURE 03

$\endgroup$

You must log in to answer this question.

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