# [ODE] center of mass

Guillaume Jouffroy oxymore at tele2.fr
Wed Oct 19 20:50:22 MST 2005

```Sorry for second posting, the question has been in another subject,
don't know why.
Hope this time it will work

I have a problem to clearly understand the center of mass position. So I
questions to try to have it limpid :-/

1. Imagine I want to build an object composed of 2 cylinders (2 geoms),
the cylinders
are linked to each other at one extremity, and form a 90 degree angle.
Where will be the rigidbody if I create this geom structure if I attach
these 2 geoms to the rigidbody ?

2. Is the center of mass at the "middle" of a geom the default ?

3. how to compute the center of mass of the whole object ? (should the
rigidbody and the center of mass
coincide ?)

4. Actually I don't really understand this part of the test_boxstack
example :
// 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]);

Just above this code the mass of the geoms are already translated and
rotated like the geoms are.
So ??? @@@#"~""é"'é~#{