Space Warp Plug-Ins

3DS Max Plug-In SDK

Space Warp Plug-Ins

See Also: Class Modifier, Class ModContext, Class WSMObject, Class WSMModifier.

In addition to Object Space Modifiers (such as Bend, Taper, Skew, etc.), 3ds max supports another type of modifier referred to as a Space Warp. Another name for this type of modifier is a World Space Modifier. Example space warps are Ripple, Wave and Bomb.

A World Space Modifier (WSM) has two components: A WSM Object and a WSM Modifier. A WSM object is just another type of procedural object (derived from WSMObject). It exists in the scene and can have modifiers (including other WSMs) applied to it. When an item is bound to a WSM object, a WSM modifier (derived from Modifier or WSMModifier) is created and inserted in the object's history.

World space modifiers are very similar to regular object space modifiers -- in fact, they are derived from the same base class: Modifier. They have a mod app that is actually in the pipeline that refers to the modifier, although WSM modifiers aren't instanced. When a user binds more than one object to a WSM object at once, a unique WSM modifier is created for each object so there is a one to one correspondence between WSM modifiers and their mod apps. This is done because a WSM modifier may contain parameters specific to that application of the modifier. For example, the Ripple world space modifier has a 'Flexibility' parameter which allows the affect of the Ripple to be scaled on a per application basis.

The main difference between a regular object space modifier and a WSM modifier is that WSM modifiers usually have a reference to the WSM object's node. Also, WSM modifiers are applied after the object has been transformed into world space.

A WSM modifier references its corresponding WSM object's node so it can get the node's world space transformation matrix. It uses this matrix to transform the points of the object it is deforming into the space of the WSM object where it actually performs the deformation. After the deformation is applied, the points are transformed back to world space. This is similar to the way object space modifiers transform their points into the space defined by the ModContext transformation matrix -- however this space is defined by the WSM object's node. So in general, if an object's node is moved, the object appears to move through the deformation field defined by the WSM object it is bound to. If the WSM object moves, a similar effect is apparent. Of course, if an object and the WSM object it is bound to move together (if one is a child of the other, for example) then the affect appears to be more like an object space modifier.

Also of note is that WSM modifiers (actually their mod apps) live in special world space derived objects. These are similar to the derived objects that hold object space modifier mod apps, except that these are contained in a specific node. Since they are associated with a specific node, they cannot be instanced.

There are two places where WSM user interface parameters can appear:

image\bullet.gif In the parameters of the WSM object. Any centralized parameters should be contained in the WSM object. Since WSM modifiers are never instanced, any parameters that the user would want to change and affect all objects bound to the WSM would belong here. For example, the Ripple WSM has its Amplitude, Phase, WaveLength and Decay parameters in the WSM Object.

image\bullet.gif In the parameters of the WSM modifier. These parameters are specific to the object bound to the WSM. For example, Ripple has its flexibility parameter here. Often time these modifiers won't need to have any parameters at all. An example might be a dynamics WSM that has modifier parameters for the objects mass and surface characteristics.