toremonster.blogg.se

Nodebox animation
Nodebox animation











nodebox animation

This is useful for animation that eases in or eases out. When it reaches -1 or 1, it goes slower, and goes fastest when it crosses 0. A sine is an oscillating function that yields values between -1.0 and 1.0 (and then back down to -1.0), but not in a linear fashion. Notice the use of a mathematical sine function in the draw() definition. Use the math sin() function to distort the curves fluidly.Use a colored rectangle to draw a background.Increase the frame variable by one (this is my frame counter).In the example above, the draw() definition basically does four things: The draw() command is called repetively by NodeBox, rendering frame after frame of animation. It's a typical example of an animation script. The variable needs to be a global, because otherwise setup() and draw() can't communicate, or share the variable. What I'm doing there in the setup() definition, is declaring a global variable named frame, which I'm going to use later on in the draw() to keep track of the animation frame being rendered on the canvas. The setup() command is run once, at the beginning of the animation, and draw() is run on each frame, or step, in the animation. You may already know a little bit about defining your own commands from the Templating tutorial. draw(): your own draw() definition, doing the actual drawing.setup(): your own setup() definition, declaring global variables and initializing them.Note that this is a maximum: big animations will require more work, and thus run slower. speed(): the speed() command indicates the speed of the animation in frames per second.The speed(), setup(), and draw() commandsįor an animation to work, it needs three things: Using the same syntax as drawing, your can turn your script into an animation, doing all kinds of wonderful, lively things.

nodebox animation

Nodebox animation pdf#

NodeBox not only exports to PDF documents and images, but handles animation as well, which can be exported to QuickTime movies.













Nodebox animation