Bounce

john's Avatar

john

27 Mar, 2020 03:55 AM

Here, for your animation pleasure, is a bounce node!

This node is somewhat hard to describe. You really have to use it to see how it works. Like the wave node it produces numbers that could be used to plot a curve. But the curve produced is a decaying sine wave with a fixed bottom and cycle tops that dampen at an adjustable rate.

The node takes five parameters:

  • Index. The time or X axis. You would normally connect a frame node to this to produce an animation.
  • Vigor. The "bounciness" of the dampening curve on a scale from 1 to 100. 1 produces a lethargic curve with hardly more than a single bounce. 100 produces a blur of bounces (a sine wave with a short period).
  • Initial height. The height of the initial peak where the damping curve starts. If animating a bouncing ball, this would be the ball's initial height.
  • Give. The extent to which an object can push through the "floor" of the curve (and produce negative y values). If set to 0 no negative values will be allowed and the object will ricochet off the floor with no give. When animating a ball you will want to set the give to an amount not exceeding half the height of the ball and deform the ball when it hits so that it deforms instead of actually passing through the floor.
  • Damping. A value from 0 to 100 that controls how fast the curve decays. A damping value of 0 will produce a sine wave. A value of 100 will immediately degrade after the first bounce.

The zip file includes three examples: a bouncing ball, a jiggling shape, and a weighted spring which starts stretched and contracts over time. The bouncing ball example plots the actual damping curve; in practice you would not show this curve in your animations.

Download the network and hit play to see the bounce node in action. Adjust the various bounce nodes to see how they affect the animation. You can multiply or divide the frame value feeding into the bounce node to control overall speed. Playing the animation inside Nodebox will occasionally skip frames resulting in some jerkiness; export movie to see a smooth animation.

I have also included a "bouncing star" animation produced with this node.

Have fun! Play!

John

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • bounce_demo_screenshot.png 520 KB
  • bounce_node.zip 3.73 KB
  • bouncing_star.mp4 8.53 MB

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

Generic

? 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

05 Apr, 2020 10:29 PM
02 Apr, 2020 07:12 PM
31 Mar, 2020 07:58 AM
31 Mar, 2020 04:13 AM
31 Mar, 2020 03:23 AM

 

27 Mar, 2020 03:55 AM
27 Mar, 2020 03:25 AM
15 Mar, 2020 09:06 PM
15 Mar, 2020 12:34 AM
14 Mar, 2020 11:59 PM
11 Mar, 2020 06:48 PM