Ship on an Ocean
One of the most common questions with RealWave is how to make an object follow a certain path and interact with the surface's waves. When you use animated objects you always have the problem that they do not react to the waves' height. A MultiJoint is the solution.
The scene's setup in the viewport's side view.
Here is the nodes list:
- 1 “RealWave” object
- 1 “Sphere” object (floating object)
- 1 “Cube” object (tractor)
- 1 “Null” object (locator)
- 1 “Gravity” daemon
- 1 “MultiJoint” node
All objects and the MultiJoint can be added from RealFlow's “Edit” menu:
- Add > Objects | Daemons | RealWave
RealFlow nodes can be moved, scaled, and rotated with the W, R, and E keys.
Imported objects from SD files have to be unlocked before they can be transformed with Selected object > Node Params > Node > SD ↔ Curve
Viewport perspective is changed with the 1, 2, 3, and 4 keys.
Shading modes are toggled with the 7, 8, 9, and 0 keys.
The Setup
Add a RealWave surface node.
Right-click on the RealWave node and choose “Fractal”.
- Open the RealWave node and select "Fractal01".
Under “Node Params” enter “Height” = 1.0, “Octaves” = 7.0, “Slope 2.0”
Right-click on the RealWave node and choose “Gerstner”
Under “Node Params” enter “DirWave = 0, “LengthWave” = 7.0
Select the “RealWave01” node and enter “Polygon size” = 0.05
Go to RealFlow's “Top” view by pressing the 1 key.
Place the sphere near the RealWave mesh's right border.
Switch to “Front” mode with the 2 key.
Let the sphere intersect the RealWave surface.
Create a cube and place it below the sphere. The RealWave mesh should be between “Sphere01” and “Cube01”.
“Sphere01” is an active, “Cube01” a passive rigid body:
- Selected node > Node Params > Node > Dynamics
Animate the “Cube” Node
The “Cube” cube is animated using two keyframes. The motion is performed along the X axes from left to right:
Move the “Cube01” node below the RealWave surface
Drag the timeline slider to frame 0
Right-click on the “Position.X” value, choose “Add key”
Drag the timeline slide to frame 150
Move the cube node to its final position
Right-click on the “Position.X” value, choose “Add key”
Right-click on the “Position.Z” or “Position.Y” value (depends on your current axis setup) and choose “Add curve”.
Type in the “Expression” field:
sin(t*2)*1.2
Position the “Null” Node
A “Null” is placed directly above “Cube01” with the W key.
Create the MultiJoint
Go to the “Creation” panel under “Node Params”:
Objects A > “Cube01”
Objects B > “Sphere01”
Creation mode > At locators positions
Locators > Null01
Create/Recreate
Open the “Forces” panel:
Switch “Force max mode” to “Constant limit”.
@ Max force > 5,000
This makes the connection between the cube and sphere nodes flexible. In other words: the cube acts like a tractor, pulling the sphere, but it still has enough freedom to become influenced by other forces or events. In this case, the waves' resistance and height will interact with the sphere. The object is spinning, creates secondary waves, and is slowed down. These influences create an offset between the linked nodes and the sphere is always slower than the cube (= tractor). When you monitor the sphere's “Position” values you can observe how the vertical position is changing over time.
Play with different “@ Max force” settings.
Adjust the “Sphere01” Node's Properties
Go to the sphere's “Rigid body” panel under “Node Params” and change “@ mass” to 200 – this will help to improve its behaviour.
In the sphere's “Realwave” panel, look for “Strength V/H” and enter 1.0 for both values.
Simulate
Click on “Simulate” to see the results.