Here is a little tutorial to make things float. Like a boat on water or a cork in wine.
We will be using a collision detection node and a target tag.
This will be the end result of the tutorial.
Lets get started with a plane animated by a flag deformer or in my case by NICKL (from Jenna).
Then we need two detection “needles” this is a long and thin polygon (orange). Place one needle in front of the boat and one at the back end.
Open the xpresso editor and drop both needles and the animated plane in it.
Connect the sticks and the plane to a collision detection node (put it in distance mode and check deformed points)
I connected the Point1 to a red sphere as to see what I am doing.
Actually we are floating already but I don’t like it. The floating movement of the sphere is much to direct.
So the next thing is to use a memory node as to get values from a few frames ago (5 frames or more), I connected this value to the green objects.
The result is a kind of inertia, it gives the impression the boat actually has weight. The longer the memory the heavier the boat.
The final step is tot pass the position value of the back green object to a “boat” null and to “target-tag” this null to the front green object as to get the inclination on the waves.
The model would look something like this.
Hit F8 and enjoy