Logo

Surface Graph tool allows you to generate three dimensional surfaces based on mathematical expressions.

01 Installation

02 Documentation

Surface Graph UI

migSurfaceGraph()

Surface Graph UI layout
fig.01 - Surface Graph UI layout


fig.02 - the plane geometry to start with


fig.03 - the resulting surface, z = x*x - y*y


fig.04 - the resulting surface generated to a cylinder cap, z = cos(d)

When the migSurfaceGraph command is executed the Surface Graph window pops up (fig.01).

  • Function textfield - See Writing the Function
  • Progress bar
    • Displays the progress when evaluating the function
  • Evaluate when Rendering Animation - See Animating the Graph
  • Generate
    • Evaluates the function for each vertex of a selected poly object and assings the function value to the vertex's height
    • Saves the user specified function as an object attribute for later use (recalling the function between sessions and for re-evaluation at render time)
    • Adds a "Graph Animate"-attribute to the object that can be used to switch rendering evaluation on and off
  • Load
    • Loads the function from a selected poly object that has been previously generated
  • Close
    • Closes the window

When evaluating the function, you should have an evenly dense geometry in order to get smooth results. A plane (fig.02) will do, but you might want to try a cylinder cap when generating distance-based functions (e.g. cos(d), fig.04).

Writing the Function


fig.05 - z = sin(10*fii)


fig.06 - z = pow(e, -d*d)

The resulting surface is a graph for a two parameter function, x and y. The function's value is then assigned to the z-coordinate. i.e. z = f(x,y).

Maya has a y-up-coordinate system, but because of the mathematical convention the tool considers Maya's x-axis as x; z-axis as y; and y-axis as z. Now the function can use x and y as its parameters and produce the result as it would appear in a z-up-coordinate system.

Here's the list of components you can use to compose your function:

  • Variables
    • x, y - The coordinate values
    • d - The distance from (0,0). A shorthand for sqrt(x*x+y*y)
    • fii - The phase angle relative to the x-axis. -pi < fii <= pi
    • t - Time, the current frame number
  • Constants e, pi
  • Operators +, -, *, /, %
  • Functions
    • sqrt, abs, min(x, y), max(x, y), pow(base, exponent), log
    • Trigonometric - sin, asin, cos, acos, tan, atan

Animating the Graph


fig.07 - Animating the surface

Using the time-variable (t) you can make your surface react to the current time of the time slider.

After enabling the "Evaluate when Rendering Animation" checkbox, every time you software render a frame, all the surfaces that have been applied a surface function get evaluated. If you want to exclude a particular object from evaluation, set the "Graph Animate" attribute off or delete the attribute.

See the sample animation: surfaceAnimation.avi (380 kB / DivX)