Menu

Gerstner Wave Deformer Tool

Tools / Maya Plugin

Gerstner Wave Tool

This is a Maya Plugin (Github) written in Python using the Maya's OpenMaya API for Python. The plugin creates a deformer node for the selected meshes to allow deformation of the mesh to represent gerstner waves.
The node has attributes to control wave direction, steepness, wavelength and movement (supports 3 waves). The video below demonstrates the plugin tool and an example of the results it can achieve.

Details:

1. Creating the Deformer Node

To create a deformer node, the plugin extends the MPxDeformerNode class available in the OpenMaya API : Maya Python API 2.0 Reference
Attributes (Art Directable Controls):

  • Wave Direction: The user can set the wave direction in the XY plane for each wave
  • Steepnes: This sets the highs and low of a wave.
  • Wavelength: This is the length of a single wave within a wave. Changing this value can alter the number of waves.
  • Movement Factor: This attribute can be used to get variations of the waves and animate flow.
  • 2. Gerstner Waves

    Discovered by František Josef Gerstner.
    When using sine function to move surface points, the points tend to only go up and down, which is not realistic for water. Water has volume and therfore, the surface points instead move within a circle. Gerstner waves algorithm models this aspect of water surface movement.
    I referred to this Gerstner Waves article to implement the algorithm.
    The algorithm works on each mesh vertex position and moves it as per the eqaution.