# Random around empy (animation nodes)

The following images show what I want to achieve with animation nodes.

So far I came up with this, but I have no idea how to combine them or if I'm on the right track:

Random transform & rotation Transform and rotation around local axis

If someone can help me with this, I would be very grateful.

You can randomly distribute points in a circle with a generator. Don't forget to slice the last element since it will be the center of the circle.

Add your cube, scale it accordingly and apply the transform with CTRL + A. Then instance it and use the previous coordinates.

Add a random array of vectors for the rotation. You can tweak the seed in the node.

Add a vector wiggle node for location. You can tweak the seed and the evolution for a nice wiggle effect. You can also use this node for the rotation to achieve the same effect. Add a float input for the amplitude of the translation.

Add a relevant shader to the base cube :

Now make it wiggle !

Result :

EDIT : Actually I didn't answer the question. You can do the actual rotation several ways. Here's how I would do it :

Create a subprogram and rotate the cubes along the Y axis, then around the Z axis so that they face the center of the circle.

Actual result :

• Very nice and a very clear explanation! I will try it today if I get the chance, but it must go right with your clear explanation :) Thank you very much Gorgious! Jun 5, 2020 at 12:19
• Hi Gorgious, I'm almost there, Just one question: What type of iterator did you use in the subpogram named Y? Jun 7, 2020 at 17:27
• I believe it is a float. Note that you can directly drag from the "iterator" output to the input of the combine XYZ node, it will automatically create an interator with the right type Jun 7, 2020 at 20:39
• Oh yeah, I missed that one, didn't know that was possible. It all works now! Thanks very much! Jun 8, 2020 at 9:12
• Yes it's pretty handy ! As you noticed you have to be aware that the new iterator takes the name of the input label, so you can can't know the type right away anymore. Glad it helped :) Jun 8, 2020 at 9:16