Specifications

28
corresponding to a given axis and rotation angle. Therefore, we can specify:
AnySeg UpperArm = {
r0 = {0, 0.3, 0};
Axes0 =RotMat(-90*pi/180, z);
When you reload again you will see that the UpperArm is indeed rotated -90 degrees about the z axis as the
function arguments indicate. Notice the multiplication of the angle by pi/180. AnyBody identifies the word
"pi" as 3.14159... and dividing this with 180 gives the conversion factor between degrees and radians.
Angles in AnyScript are always in radians, but anywhere a number is expected you can substitute it by a
mathematical expression just like in other programming languages.
In the next section we will look at how joints can be used to constrain the movement of segments and allow
them to articulate the way we desire. So if you are up to it, let's continue onward to Lesson 3: Connecting
segments by joints.
--------------------------------
*In rigid body dynamics terminology, a "segment" would be called a "rigid body", but to avoid unnecessary
confusion between the rigid bodies and the total body model, we have chosen to use "segments" for the
rigid parts of the model.
Lesson 3: Connecting segments by joints
Here's an AnyScript file to start on if you have not completed the previous lesson:
demo.lesson3.any
.
You can think of joints in different ways. We tend to perceive them as providers of freedom, which is correct
compared to a rigid structure. However in dynamics it is often practical to perceive joints to be constraining
movement rather than releasing it. Two segments that are not joined (constrained) in any way have 2 x 6 =
12 degrees of freedom. When you join them, you take some of these degrees of freedom away. The
different joint types distinguish themselves by the degrees of freedom they remove from the connected
segments.
A segment without joints is basically floating free in space. When you connect the segments by joints, you
bind them together in some sense. But the mechanism as a whole can still fly around in space.
Not knowing where stuff is in space can be very impractical so the first thing to do is usually to ground the
mechanism somewhere. Perhaps you remember that the system added these lines somewhere in the top of
the AnyScript model:
AnyFixedRefFrame GlobalRef = {
// Todo: Add points for grounding
// of the model here
}; // Global reference frame
This is actually the definition of a global reference frame of the model. You can think of it as a coordinate
system fixed somewhere in global space. Otherwise, it is just like a segment in the sense that we can add
points to it for attachment of joints and muscles. Lets do just that. Again you can insert the objects with the
object inserter or to save time simply cut and paste the following lines into your model:
AnyFixedRefFrame GlobalRef = {
AnyDrawRefFrame DrwGlobalRef = {};
AnyRefNode Shoulder = {
sRel = {0,0,0};
};
AnyRefNode DeltodeusA = {