Specifications

169
afterwards. To directly drive just one coordinate we need a driver file with just one column of data in
addition to the time column. Please download this version: p1x.txt
and save it in the same directory as the
other files of the model. Then make the following changes:
AnyKinEqInterPolDriver P1Driver = {
Type = Bspline;
BsplineOrder = 4;
FileName = "P1x.txt";
AnyKinMeasure &Lin = .P1Lin;
MeasureOrganizer = {0};
Reaction.Type = {Off};
};
The interpolation driver now uses the new file with just the x coordinates. The MeasureOrganizer is a
property you can use to select the pertinent components of the kinematic measure you are driving. The
measure returns an {x,y,z} vector, and MeasureOrganizer = {0} means that we are picking only the first
component (number 0 because all numbers begin with zero in AnyBody) to drive. Finally, since we are only
driving one coordinate, the Reaction.Type vector should now only have one component.
Load the model again, and run the kinematic analysis. You should now see it moving from side to side as
you would expect a pendulum to do. So far so good!
Let us briefly review what we have learned so far:
Models can be driven by MOCAP data
You need to drive as many degrees of freedom as the model has ? no more and no less.
You must choose the coordinates to drive carefully.
There are in fact more issues to consider and smarter ways to create the drivers, and these are the subjects
of the next section.
Local and global coordinates
Before we begin, here?s a link to a functioning model in case you had trouble with the preceding section:
mocap2.any
.
We begin this section with a question: Will this also work if the oscillations are larger? We can try it very
easily. Please download and save this file: p2x.txt
. Then make the following change:
AnyKinEqInterPolDriver P1Driver = {
Type = Bspline;
BsplineOrder = 4;
FileName = "P2x.txt";
AnyKinMeasure &Lin = .P1Lin;
MeasureOrganizer = {0};
Reaction.Type = {Off};
};
Run the kinematic analysis again. You will see the pendulum moving in a non-pendulum-like fashion. More
precisely the pendulum makes an additional cycle at each end of its primary movement. This was not the
movement that was motion captured, so the analysis is in fact wrong.
The reason for the problem is that the global x direction does not determine the movement very well when
the pendulum is close to horizontal. Here, driving in the y direction would be much better.
The elegant solution to the problem is to change coordinate system of the driver. If the driver works in the
pendulum coordinate system rather than the global coordinate system, then the x direction will be tangential