Floating Objects

Some object shapes seem to be unusable with RealWave, in particular long objects which should float upwardly between the waves of a RealWave surface. For a few moments they seem to behave correctly, show some up and down motion, but then they turn over. The reason for this behaviour is the objects' centre of gravity. RealFlow provides are very easy method to shift this point and make it visible. This tutorial does not only work with RealWave surfaces, but in every situation where you have to prevent floating objects from turning over.



A buoy on an endless ocean rendered with Maxwell Render. The buoy is tied to its position with a MultiJoint.

 

Here is the nodes list:

  • 1 “RealWave” object
  • 3 “Cube” nodes
  • 1 “Gravity” daemon

 

All scene elements can be added from RealFlow's “Edit” menu:

  • Add > RealWave | Objects | Daemons
  • RealFlow nodes can be moved, scaled, and rotated with the WR, 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 123, and 4 keys.
  • Shading modes are toggled with the 789, and 0 keys.

The Setup

  • Add a RealWave surface (there cannot be more than one RealWave node in a scene).

  • Rescale the surface to your needs with the R key or the parameters under Node Params > Scale. The surface should be a squared mesh.

  • Right-click on the “RealWave01” node and choose Add Wave > Fractal

  • Add a “Gerstner” modifier

  • Create three cubes and change their vertical scale to values of 2.0, 2.5, and 3.0 (Node Params > Node > Scale)

  • Spread the cubes randomly over the RealWave mesh with the W key and shift them downwards so they intersect the wave surface. About 2/3 of the cubes should be above the water level.

  • Add a “Gravity” daemon.

 

Adjusting the Deformers

Select Fractal01 > Node Params > Fractal and Gerstner01 > Node Params > Gerstner, and make the following settings:

 

 

Adjusting the Cubes

  • Select the first cube.

  • Node Params > Node > Dynamics > Active rigid body

  • Node Params > Rigid body > @ mass > 500.0 (see below)

  • Repeat the steps above for the remaining cubes

The First Simulation

Click on “Simulate”. After a few frames the cubes turn over due to the waves' motion.

Adjusting the Cubes' Centre of Gravity

In this short tutorial, the centre of gravity is shifted along an object's height axis. It depends on your current preferences which axis is used:

  • Preferences > General > Axis Setup

The drop-down menu provides three different setups and you have to adjust RealFlow to your 3D package to maintain the correct orientation of imported objects. The first letter indicates which axis will be used as the height axis.




  • Cube01 > Node Params > Display > Show CG > Yes

  • Switch to RealFlow's “Wireframe” mode with the 8 key to make the CoG visible – it is a small yellow square in the cubes' midpoints

  • Select “Cube01”

  • Node Params > Rigid body > @ CG > Y/Z > -0.25

  • Repeat these steps, but use different “@ CG” values (-0.5 and -0.75) for the remaining cubes

 

“@ CG” values are relative to an object's size. This means that 0 represents the body's midpoint, while the total length is considered 1. When you enter a value of -0.5 the CoG will be the object's bottom; with 0.5 it is its top. With values greater 0.5 or smaller -0.5 it is possible to shift the CoG outside the object. This is an easy way to control the object's floating behaviour.

The Simulation

Click on “Simulate”. According to your settings the cubes will float. With a CoG close to a node's midpoint it may happen that the body is still tipping over. Play with different “@ CG” values and change all three parameters (XYZ).