4Point Surface Constraint in ICE

When rigging swimming or flowting things it’s not the best idea to put the hole object under one null and to rotate that. A better idea is to make a linear surface grid with four points, cluster constrain the four points to nulls and create a fifth null which is surface constrained to the middle of the surface.

As shown in the fist picture, the null moves/rotates nicely between the four control points. The principle is not new. There is also an Rigging solver of Studio Nest out there that does exact this.

Point Surface This solver computes a transform on a iso surface build by 2D bezier curves. These curves are defined by 4 controllers (the corners of the iso surface). 

article: Sixbirds Rigging Solvers
backup: search for “Brigks”

When thinking of this case I asked myself how I would realize this within ICE without a real surface. I came up with a small graph that I try to explain.

4 point surface - picture 2

First of all we need the global positions of the four nulls.

4 point surface - picture 4

With that done we drop two “Bezier 4” nodes in. For thous of you who don’t know what the node is doing, read this Article on Wikipedia, and/or watch the video-tutorial of Bradley Gabe on Vimeo. That will clarify what this node is doing. Plugin in the Vectors as shown below. The order depents on position of the control nulls.

4 point surface - picture 4

Next we need two “Scalar” nodes for the U and V coordinate, two “Clamp” nodes and one “Linear Interpolate” node. Connect the output of the “Bezier 4” nodes to the inputs of the “Linear Interpolate” node. Then connect each “Scalar” node to one “Clamp” node and set the clamp-range from 0-1. With this way we make sure that the range is always right. Connect one of the “Clamp” nodes the the “Bezier 4” nodes (this will be our V coordinate weight), and the other one to the “Linear Interpolate” node weight (this will be our U coordinate weight). Ok, that’s all for the position logic.

4 point surface - picture 5

For visualization purposes I took a “Add Point” node, pluged in in the 3d position vector and initialized the basic particle attributes. Further more I used some linear interpolation nodes to visualize the current u and v on the grid. This ones are not necessary to get the Constraint working.

4 point surface - picture 6

The result of this graph looks like this. The ICE setup aligns perfectly the traditional surface constraint.  The blue points visualize the u coordinate and the red points the v coordinate. The only thing missing here is the proper rotation.

4 point surface - picture 6

The next step is a bit tricky and not THE solution, but I found this one  working best for me. The fist step is to get the vector for the U Coordinate by subtracting and interpolating. Second step is to do the same for the V  Coordinate. With that working we can calculate the third vector we are after with the “Cross Product” node.  For more information about that look at the Wikipedia article. By putting this three vectors in an  “3D Vector to 3×3 Matrix” node we can get an approximation of the rotation. Just resplit the Matrix back to SRT and plug the rotation in the  Particle Orientation Port.

4 point surface - picture 8

As shown below, the result lines up nicely to the traditional surface constraint.

4 point surface - picture 9

In some extreme cases, there are problems with the rotation. But for simple setups, this ICE graph could be an solution. Also it’s possible to drive Objects via ICE Kinematics with this method. I hope you like this small tutorial.

4 point surface - picture 10

Download the Compound: AB _ 4 Point Surface Constraint

Thanks!