Lien 's Avatar


21 Mar, 2016 05:10 PM

I'm new to NodeBox. I don't understand how I can animate the lines I've drawn.
Could someone help me?

  1. Support Staff 1 Posted by john on 21 Mar, 2016 10:25 PM

    john's Avatar

    Hi Lien,

    Welcome to the NodeBox community. I hope you will enjoy NodeBox as much as we do and post often to the forum.

    Animation in NodeBox is done by adding a frame node and then letting that node control the output.

    All frame does is output a sequence of integers starting with 1 (1,2,3...) which correspond to each frame of your animation. By using each frame number to slightly alter what is drawn by the rendered node you can gradually move or resize or rotate or recolor various elements to form a smooth animation of however many frames you want.

    To illustrate this I am attaching a NodeBox network similar to yours along with a screenshot and the animation it produces. The animation starts with a single line which clones and scoots over to form 20 lines; this takes 30 frames. The animation pauses for 20 frames then over the final 50 frames each line gradually rotates to a random orientation. Let me walk you through it.

    At the top is the frame node. It feeds into two convert range nodes, one for the frames 1-30, the other for frames 50-100. The first of these generates a series of coordinates (x slowly increases, y is unchanged) which feed into the translate port of the copy node. This causes the 20 lines to gradually separate.

    The second convert range node kicks in at frame 50, gradually producing a fraction from 0 to 1. I multiply this by a a set of 20 random angles (varying from -79 to +79), one for each line, and feed that into the rendered rotate node. The effect is to slowly move from the starting angle (0) to the random ending angle.

    You can play with this by scrubbing (dragging) the frame indicator in the lower left corner or just hitting the Play button. To adjust your animation you can set the frame indicator to a certain point and then fiddle with the Target End of the range converters or the number of lines in the copy node or the range of angles in the random node or the seed of the random node until you get the effect you want. You can change Source Start and Source End in the range converters to make one section of your animation run faster and another run slower.

    When you're happy, choose "Export Movie..." from the file menu and define how many frames you want to generate. You can determine the dimensions of the movie by changing the height and width of the document under the "Document Properties..." menu (I set my example to 500 x 500).

    That's all there is to it. The only cleverness required is to figure out how to transform the frame number into whatever values you need to alter the drawing.

    Hope that helps!


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • Schermafbeelding_2016-03-21_om_18.08.37.png 227 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

30 Nov, 2023 05:40 AM
29 Nov, 2023 01:33 PM
29 Nov, 2023 05:30 AM
28 Nov, 2023 10:03 PM
28 Nov, 2023 12:38 AM


27 Nov, 2023 04:40 AM
26 Nov, 2023 10:02 AM
22 Nov, 2023 09:33 AM
20 Nov, 2023 08:54 PM
17 Nov, 2023 01:43 AM
15 Nov, 2023 06:58 AM