RSS< Twitter< etc

<< Selection Modifiers

Vertex Selection By Surface Distance

The following example uses the NearestPoint operator to calculate the shortest distance to a mesh surface and sets the Vertex Soft Selection proportionally to the distance. This is a step beyond what Vol.Select can do in 3ds Max since it does not test against a volume but basically detects mesh intersections.

Creating a Test Scene

  • Create a Teapot with Radius 30.0
  • Create a Plane with 100x100 segments and size 200.0x200.0
  • Add a Genome modifier to the Teapot, set to "VERTEX" iteration mode.

  • Click the "Open Magma Editor" button and press Ctrl+[O] to create an Output node, set to Selection channel.
  • Click in the Editor to deselect, then press [O] and [N] to create a NearestPoint operator.
  • Drag a wire from the Geometry input socket and release over an empty area of the Editor to create an InputGeometry node. Pick the Plane as the Geometry object.
  • Drag a wire from the Lookup Point (WS) input socket and release over an empty area of the Editor to create a Position InputChannel with ToWorld conversion.
  • Connect the Distance output socket of the NearestPoint to the Output node.
  • Select the NearestPoint node again and press [A] and [B] to insert an Absolute operator. We want this because the Distance value is signed, that means points underneath the plane would get a negative distance, points above it a positive distance.
  • Press [/] to insert a Divide operator.
  • Press Ctrl+[1] to create a Float input and change the value to 40.0.
  • Select the Divide operator again and press [F] and [C] to insert a Clamp operator. Leave the defaults at 0.0 to 1.0.
  • Press [-] to insert a Subtract operator and press Ctrl+[W] to swap the first and second input sockets, producing (1-ClampedValue) calculation.
  • Finally, press the [6] key on the top row of the keyboard to insert a Power operator.
  • Press Ctrl+[1] to connect a Float InputValue with value of 1.0 to the Power.

RESULT: The vertices close to the Plane are selected, with the selection falling off with the distance and becoming 0.0 and 40 units from the Plane.

Moving the Plane up 25.0 units along world Z, setting it to See-Thru and changing the Distance parameter to 20.0 shows a Soft-Selection band of 20.0+20.0 units on both sides of the Plane (left image). Adding a Noise modifier to the Plane also affects the selection since the distance to the surface is now variable (right image):


We can use the selection to control deformations, for example we can add a Push modifier (either the 3ds Max one or the Genome equivalent) with a value of 10.0 to push the vertices along their normals according to the Soft Selection. 


Note that we can convert the Genome modifier to an actual Push By Surface Distance modifier by switching the Output channel to Position and adding the Normal to the Position based on the Distance factor. But a Selection version is more flexible since it can control any deformation modifier above it.