Exponential and Settle Nodes

john's Avatar

john

20 Dec, 2024 01:02 AM

TWO new nodes, both primarily for creating motions.

Exponential changes values over time at an exponential rate. You can feed in a range node and create an exponential curve, or use the values to drive a rising or falling animation.

Settle calculates values for a decaying sine wave. You can also use it to create a curve, or use the values to drive animations like pendulums or bouncing balls. You can also hook them together to make more complex curves or motions.

EXPONENTIAL

The exponential node is similar to the easing node, but is faster and more adjustable. It takes the following parameters:

  • Value. A changing value, typically from a range or frame node.
  • Source Start. The value at which the curve will begin.
  • Source End. The value at which the curve will end.
  • Target Start. The initial output value.
  • Target End. The final output value.
  • Power. The exponent driving the curve:
    • Power = 0 produces a flat line with all outputs equalling the target end value
    • Power = 0 > 1 produces an inverse power curve
    • Power = 1 produces a diagonal line between the target start and end values
    • Power > 1 produces an increasingly steep exponential curve
  • When provides two possible values:
    • Ease In. Start with gradual change and accelerate at the end.
    • Ease Out. Start with rapid change and taper off.

SETTLE

The settle node is based on the wave node but was designed to be easy to use for animations. It takes the following parameters:

  • Offset. A changing value that moves along the sine curve. Offset values less than 0 will move through a non-decaying sine wave. Offsets equal or greater than the duration will converge to the final value.
  • Min Max. The minimal and maximum values of the initial sine wave.
  • Final. The final value the wave will converge to. For pendulums this is typically half way between the min and max values. For bouncing balls settling to a floor this is typically equal to the max value (since larger y values land farther down on the screen).
  • Duration. The time it takes the the sine wave to collapse to its final value, in frames for an animation or X values for a horizontal wave plot.
  • Period. The period of the sine wave. Minimum allowed value is 1.
  • Phase Shift %. The part of the sine wave you want to start the decay, based on the standard Nodebox wave function:
    • 0% starts halfway between min and max heading upward toward min
    • 25% starts at the top of the wave's peak
    • 50% starts halfway between min and max heading downward toward max
    • 75% starts at the bottom of the wave's trough.
    • 100% returns to the start (and is no different than 0%)
  • Decay Rate. The exponential rate at which the wave collapses to its final value:
    • Rate = 0 produces a steady, non-collapsing sine wave
    • Rate = 0 > 1 produces a sine wave that collapses slowly at first
    • Rate = 1 produces a steadily collapsing sine wave
    • Rate > 1 produces a sine wave that quickly collapses and then converges slowly

The attached demo shows the an exponential curve in blue and a settle curve in red (see screenshot and animation).

To create the blue exponential curve I feed a range node into the exponential node with source values matching the range values and target values leading from 0 upwards to a y value of -300. By making the target end a positive number, you can make the curve go down instead of up. Change the power to control the steepness of the curve. Switch from Ease In to Ease Out to control when the change happens.

The red settle wave is created in much the same way. Change the final value to the max value to make the wave settle to the bottom instead of the middle. Increase the duration to stretch out the wave. Change the period to tighten or relax the wave. Change the phase shift to start the decay at the peak or trough. Change the decay rate to control the speed of the collapse.

I also provide a separate network to create a very simple pendulum animation using six settle nodes. The first five nodes have decay rates varying from 0 to 4. At rate 0 the pendulum never settles and swings forever. At rates 1 to 4 the pendulums settle down, slowly but surely at rate 0, more quickly for the higher rates.

The last pendulum shows an example of how to combine the exponential and settle nodes to create more complex curves - or in this case more complex motions. The exponential curve falls with increasing speed from 100 to 25. By feeding this into the settle node's period parameter, you can make the pendulum swing back and forth faster and faster even as the total width of those swings settles. To see all six pendulums swing at once, just render the combine4 node and hit Play or watch the attached movie.

(I have also provided an extra exponential node in the network that draws the red settle curve. Attach it to the settle node's period parameters to further refine that curve,)

Both of the nodes are fun to play with and can create a wide variety of interesting curves or motions. For even more exotic curves, you can peer inside the settle node and change the two exponential curves inside it to Ease In instead of Ease Out. For even more bizarre results, try changing the wave node inside settle from Sine to Square, Triangle, or Sawtooth.

Have fun swinging and bouncing!

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • exponential_and_settle_screenshot.png 539 KB
  • pendulums.mp4 451 KB
  • exponential_and_settle_demo.ndbx.zip 6.12 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

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

26 Jan, 2025 02:09 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM

 

21 Jan, 2025 09:36 AM
21 Jan, 2025 02:00 AM
16 Jan, 2025 08:30 PM
15 Jan, 2025 06:37 AM
04 Jan, 2025 04:09 AM
03 Jan, 2025 05:32 PM