Following on from my recent post about creating a double pendulum in SideFX Houdini, here's another project that roughly simulates the effect of a magnetic pendulum and visualizes the resulting attractor.
The system consists of a single pendulum and four fields visualized as small spheres. The blue spheres indicate a repulsive radial force and the red spheres indicate an attractive radial force.
Perhaps surprisingly, Houdini doesn't come with a radial force "out-of-the-box", so I turned to the VOP Force dynamics node to create my own. This node allows the creation of custom forces based on a VOP network and sits inside my DOP network. My radial force looks like this:
It's not quite a gravitational force because it ignores mass, but my node does apply an impulse in the direction between the affected object and the input position based on the inverse square of the distance between them.
The one gotcha was that, by default, Houdini dynamics "sleeps" stationary objects. Luckily, my pendulum RBD Object has an initial velocity and remains active over the 500 frames in the video above.
The final DOP Network has four of these custom radial force nodes - two with negative strengths and two with positive strengths yielding the final result.