[ODE] Geom Transforms hate me

Panayoti pany2002 at urbansquall.com
Wed Sep 24 22:59:46 MST 2003


I've spent the last few days trying to figure out how the smack I can
get Geom Transforms to surrender to my will. Alas, the current score is
about GT 25, me 0. Anyway, in my search for new ammunition to tackle my
problem, I've been looking at the example source code, and noticed
something that I didn't quite understand that is used during the
construction of "composite" objects in some of the ODE tests:

	// add to the total mass
	dMassAdd (&m,&m2);
      }

      // move all encapsulated objects so that the center of mass is
(0,0,0)
      for (k=0; k<2; k++) {
	dGeomSetPosition (g2[k],
			  dpos[k][0]-m.c[0],
			  dpos[k][1]-m.c[1],
			  dpos[k][2]-m.c[2]);
      }
      dMassTranslate (&m,-m.c[0],-m.c[1],-m.c[2]);
    }

So, can someone explain to me what is going on? I hate to be this guy,
but I really don't know what else to do. I really don't understand how
I'm supposed to be manipulating the physical mass in order to get the
correct center of mass. Also, why do we then change the position of the
encapsulated objects? 

Incidentally in my own code I've managed to get the transforms to load
correctly using transforms, but the behavior is off (3 equally sized
spheres of equal mass next to each other, on one physical body, have a
distinct "heavy" side which, to me, means that I've done something funky
with the center of mass calculation).

I would paste the code from my example here, but I cannot for reasons
that are too stupid to get in to.

Thank you so much for your help,

Pany




More information about the ODE mailing list