2

How should we replicate this animation within Animation Nodes 2.1?

Animation

By: https://twitter.com/InfinityLoopGIF/status/1085886521205538817

Omar Emara
  • 22,639
  • 5
  • 55
  • 103
  • Can we edit title to something more meaningful? Also there is similiar question, except it is about default tools: https://blender.stackexchange.com/questions/16467/is-it-possible-to-twist-a-circle-into-a-sphere – Serge L Jan 23 '19 at 21:31

1 Answers1

4

We start by creating a helix using the following equation:

$$ \begin{aligned} x &= \cos{ft}\\ y &= \sin{ft}\\ z &= t \end{aligned} $$

Where $t\in[-1, 1]$ and $f$ is a factor of frequency. This is implemented in Animation Nodes as follows:

Helix

We then vary the radius of the helix such that it lies on a unit sphere. To do so, we note that since $t\in[-1,1]$ represents the z location of the points, then $\sqrt{1-t^2}$ represents the $x$ location of the point if the point lie on a unit circle, or in our case, a cross-section of a unit sphere. This is due to the fact that:

$$ \cos^2{t} + \sin^2{t} = 1 $$

Hence our equation become:

$$ \begin{aligned} x &= \sqrt{1-t^2}\cos{ft}\\ y &= \sqrt{1-t^2}\sin{ft}\\ z &= t \end{aligned} $$

which can be implemented as follows:

Sphere Spiral

This gives us only half of the spiral, to get the full spiral, we flip the spiral and combine it with the original as follows:

Full Spiral

We then use those vectors to construct a spline:

Construct Spline

We then replicate the output spline by rotating it along the z axis with angles of:

$$ \frac{i\pi}{n} \ \forall \ i \in \{0\dots n-1\} $$

Where $n$ is the number of splines. This is implemented as follows:

Replicate Spline

Which gives this result:

Result

Omar Emara
  • 22,639
  • 5
  • 55
  • 103
  • I love how you use maths and nodes here. Great for others to do brainpicking. Do you know any book on abstract algebra that you could recommend to absolute novice like myself? I am few weeks learning it. – Rita Geraghty Jan 23 '19 at 18:07
  • 1
    @RitaGeraghty I don't know abstract algebra myself, so you probably know more than I do. Reading is useful, but you have to start applying, knowing theory doesn't translate easily into implementation knowledge. – Omar Emara Jan 23 '19 at 18:16
  • Omar, ok. Thanks. I know just intermediate maths. I'm now relearning maths. I once did honour maths, but I've forgotten them. – Rita Geraghty Jan 23 '19 at 18:37