Pendulum Tool

We created a custom pendulum and turned it into a Houdini Digital Asset(HDA) where the artist has control.

Here is the HDA:

The artist can set the initial angle, angular velocity, rod length, rod radius, gravity, damping, sphere size, color of the rod, and color of the sphere.

We used the solver node and VEX code in the Attribute Wrangle node to update the angular position and angular velocity of the pendulum.

if (@ptnum == 0)
 {
     // Explicit Euler Simple Pendulum with damping
     f@Theta += f@Omega * @TimeInc;
     f@Omega +=  (-f@g/f@line_length * sin(f@Theta) - f@damping * f@Omega) * @TimeInc;
 // Convert to Cartesian Coordinates @P.x = f@line_length * sin(f@Theta); @P.y = -f@line_length * cos(f@Theta);
 }

In this render, we set the damping so that the pendulum quickly comes to rest:

Leave a comment