[ODE] Origin of Composite

Chris M. czb182 at hotmail.com
Tue Aug 8 17:11:59 MST 2006


Hello, I'm currently trying to build a vehicle of various geoms, and assign 
an arbitrary center.  The reason
being is that I want to place other objects with respect to that center.   
>From what I'm reading, dBodyGetPosition returns  center of mass as origin.  
Well, I'm trying not to worry about mass distribution just yet, but is it 
necessary to just the point of reference?

I built the vehicle with a single box as the body and tried using 
geomTransform, but getbodyposition still returns the same value.  Here is 
some code.
        / /insert code here to create body and set position
	m_geom_transform[i] = dCreateGeomTransform (m_local_space);
	m_carg[i] = dCreateBox (0, m_robot_width, (m_robot_height), 
m_robot_length);
	dGeomTransformSetGeom(m_geom_transform[i], m_carg[i]);
	dGeomSetPosition(m_carg[i], 0, 0.56, -0.66);//translation numbers to move 
point of reference
	dGeomSetBody (m_geom_transform[i], m_carb[i]);

How can I have it so that i create a geom and body,  and have the actual 
object be where my dbodysetposition set it too, but when I do a 
dBodyGetPosition I get values that are transformed by some amount that i set 
.  So basically, if I created an object, moved it up 1 unit, then i want to 
adjust point of reference by -0.5.  So now if I did a dBodyGetPosition, it 
would return 0,0,-.5 instead of 0,0,0 because the point of reference is now 
behind origin of world, but the actual object would still be centered at the 
origin.  I thought that was what geom transform were, but maybe I'm just 
using them wrong.

Any ideas or suggestions?
-Chris M.




More information about the ODE mailing list