In the GaitLowerExtremity model I have to make a reference frame trough the thigh segment via the bony landmarks in the epicondylus to the hip joint. I made a vector through those points but I have still some questions. What exactly does the AnyVec3 do and How can I get exactly a reference frame trough those two points?

Please take a look at the RotMat(AnyVec3 Pnt1, AnyVec3 Pnt2, AnyVec3 Pnt3) function.

RotMat3Points
Rotational tranformation matrix for a coordinate system defined by three points. The first point is the origin of the system; the second gives the direction of the first (x) axis. Together all three points must span a plane which will be the plane of the first (x) and the second (y) axes, having the third (z) axis as normal.

And define your reference frame by constructing Origin and Axes accordingly:

Thanks for your reply. But I still have one remaining question. If you have two nodes in a segment. How can you get the original point of a node in this frame. Because the sRel is in local coordinates and the FixedRefFrame in global coordinates. And I have generated this vector [SIZE=3]
[SIZE=2]AnyVec3[/SIZE][/SIZE] ShankVec = -IntraTibialEpicondyle.sRel-IntraMallolar.sRel ;

How can I get the Axes trought that vector in the AnyFixedRefFrame class?

These nodes would have .r and .sRel members, where .sRel as you said local, .r is the global one. You can also define your new reference node within the same segment using relative terms:

[SIZE=3][SIZE=2]AnyRefNode[/SIZE][/SIZE] ShankRefFrame ={
sRel=.IntraMallolar.sRel;
ARel=RotMat(.IntraMallolar.sRel ,.IntraTibialEpicondyle.sRel,.KneeJoint.sRel )
[SIZE=2]};[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]But the rotations aren’t what I need. The Y direction is the forward direction the X-axis is the vertical direction and the Z-axis is the lateral direction. The rotations must be oriented as follows: The Y-Axis need to go from the Intramallolar to the IntraTIbialEpicondyle. The X-axis need to have a forward direction and the Z-axis needs to be the lateral directions. How can I achieve those rotations?[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Best regards,[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Hans

Construct a node on the needed X axis and use it as a second parameter. Use .IntraTibialEpicondyle.sRel as a third parameter to have Y as vertical axis, or construct another node on perpendicular plane using cross product function: cross(AnyVec3 u, AnyVec3 v), and use it as a second parameter - then the Z axis will be vertical.

Or an easy solution: multiply by RotMat(90pi/180, z) or RotMat(90pi/180, x) or RotMat(90*pi/180, y) needed number of times.

Thank you for your reply and this helps me indeed a lot but I have one remaining thing left. In the right leg the X-Axis is indeed forward now but in the left leg the X-axis is more lateral oriented. How can I fix is that in both legs the X axis turns forward?

You can always define a second ref. frame (left-leg-specific) and if you want to use the same name later on you can define a reference to the object, like:

Where can I put this code because if I’m doing this code:

within the shank:
Main.HumanBody.Left.LegShank ={AnyRefNode leftdummyNode={
sRel={0,0,0};
};
};
I will get this error:
[SIZE=1][SIZE=1]Loading Main : “H:\J.H.Schreuders\AMMRV1.3\Application\Examples\GaitLowerExtremity\GaitLowerExtremity.main.any” Scanning… Parsing…
[COLOR=#0000ff][SIZE=1][COLOR=#0000ff]ERROR(SCR.PRS1)[/SIZE] : [SIZE=1]H:/J.H.Schreuders/A…3/Body/A…n/LegTD/Seg.any[/SIZE] : ‘leftdummyNode’ : Object already declared at :
[SIZE=1]H:\J.H.Schreuders\AMMRV1.3\Body\AAUHuman\LegTD\Seg.any(844)[/SIZE] : ‘leftdummyNode’ Model loading skipped

Please reread the error message - it normally explains what the problem is. It looks like you defined this dummy node in Seg.any as well as in the Main file, is that so? It should not be either in Seg.any or in the Main file. Please note that the same Seg.any is used for the right and left legs - therefore this node will be copied, however, if you create it like i suggested then it won’t be duplicated.
Regarding location: you can add these lines in the Main file or wherever you want as long you make correct paths.
By the way - “Main.HumanBody.” path i took from the top of my head - please use correct paths and real objects, e.g.: Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Shank - you can go to the model view and right click on any object - it will suggest to ‘copy complete name’.

I posted yesterday a question about a specific orientation of a local reference fram. I tried to calculated the point by myself but after loading the initial conditions it doesn’t have the appropiate orientation. What can I do to achieve the appropiate orientation?

When using the RotMat function with three point the Y axis will almost never go exactly through the third point. Not unless the three points are perfectly placed and forming a 90 deg angle.

So the most important direction must be driven by the second point in the RotMat. I understand that in your case it is the intratibialEpicondylle. Your ARel is then:
ARel=RotMat(.IntraMallolarRight.sRel, ,.IntraTibialEpicondyleRight.sRel, .DummyNodeRig ht.sRel );

Now you have the X axis going exactly through the intratibialEpicondylle. If you want it to be Y or Z instead you just add one or more RotMat to the ARel with 90 deg rotations to switch around the axis. Something like this:
ARel=RotMat(.IntraMallolarRight.sRel, ,.IntraTibialEpicondyleRight.sRel, .DummyNodeRig ht.sRel )*RotMat(pi/2,z)*RotMat(…);