Mirroring

Hello Anybody,
I would like to ask you about one problem. I created a model of hand in Anybody modeling system. I had to create a left hand because of available VHP data (photos). But now, for Vicon measurement I need to transform whole model to right model (lots of bones, muscles, ligaments etc.).

It occurred to me to wrap whole model to one node and this node transform. But ,maybe, it is bad decision :confused:

But I really don’t know how I can do it. Or is there some tutorials about it?

Please help me. Anything. I’m in despire :frowning:

Best regards

Veronika

Hi Veronika,

Good news is this should be feasible, but it requires a few systematically changes in the model to do this.

The simplest way to do this would be to flip one of the coordinates.

We usually write something like this for each node… sRel= {x,y,…Sign*z}; or similar. Here we have Sign =1 for the right side and Side =-1 for the left side. In your case it would be the other way around. It can also be that you want to flip a different axis.

Sign is defined outside the files defining the segments so that you can include the same segments twice with a different sign.

Right ={
AnyVar Sign=1; //vise versa in your case
#include “seg.any”

};

Left ={
AnyVar Sign=-1; //vise versa in your case
#include “seg.any”

};

Best regards
Søren

Thank you very much Soren. I tried it, but maybe I didn´t understand it well.

I have program like this:

Main = {

AnyFolder HandModel = {

AnyFixedRefFrame GlobalRef = {
    Origin={0,0,0};
    ----->here few nodes inside
     };

////BONES*******
AnyVar Sign=-1;
#include “HandModelFile\Bones\Segs.any”
//***********************************************
//JOINTS*************
#include “HandModelFile\Joints\Jnts.any”
//**************************************************

//////DRIVERS***********
// #include “HandModelFile\Drivers\Drivers.any”
//// //**************************************************

//MUSCLES***********
// #include “HandModelFile\Muscles\Muscles.any”
//**************************************************

//LIGAMENTS***********
// #include “HandModelFile\Ligaments\Ligaments.any”
//**************************************************

}; // HandModel

Segments are connected together like this:

AnyFolder Segs = {

AnyVec3 rw = {-0.08, 0.06,-0.04};
AnyMat33 S = RotMat(0pi/180,x)RotMat(0pi/180,y)RotMat(0pi/180,z);
AnyMat33 Axes0Wrist = RotMat(-90
pi/180,x)RotMat(180pi/180,y)RotMat(90pi/180,z);

AnySeg WristLunateB = {

AnyVec3 rLunate={0.02,0.005,-0.005};
r0 = .rw + (.Axes0Wrist*rLunate’)’;
Axes0= .Axes0Wrist ;
Mass = 0.00892;
Jii = {0.000000616,0.000000622,0.000000297};
-----> here are lots of nodes and obstacles etc.

AnyDrawSTL DrwSTL = {
     FileName = "lunatum_new.stl";
   };

AnySeg WristScaphoidB = {

  AnyVec3 rScaphoid={0.0124,-0.0116,-0.001}; 
  r0 = .rw + (.Axes0Wrist*.S* rScaphoid')'; // Axes hlavni nahore
    Axes0= 
 .Axes0Wrist*RotMat(0*pi/180,x)*RotMat(0*pi/180,y)*RotMat(0*pi/180,z); 

…
So if I change rw, whole my hand will translate.

I tried lots of ways, but the result was only translation, not mirroring. Please help me, I really don´t know.
:confused:

Hi

You will need to add the Sign on all sRel values in the model, in the code you have displayed there are no sRel values.

I can be done for example like this:

AnyMat33 Mirror={{…Sign,0,0},{0,1,0},{0,0,1}};

AnyRefNode somenode ={ sRel = {0.00000, 0.000000 , -0.0030000}*.Mirror;};

Same goes for bone files:

AnyDrawSurf DrwSurf = {
FileName = “Humerus_bone”;
ScaleXYZ = ({1.0,1.0,1.0})*…Mirror;
};

Please have a look in the seg.any file in the arm or leg folder in the repository for more examples.

Maybee load a model and check the sames values for left anr right to see what goes on.

Remember also thay r0 and Axes0 are just initial guesses on positions, so once first step is solved these are irrevelant, but it is always a good idea to make good initial positions

Best regards
Søren