[ODE] complex geometries

skjold@cistron.nl skjold at cistron.nl
Fri Mar 14 08:37:01 2003


Hi Christian,

Ok, I haven't tried it yet, but at first glance I couldn't tell why it's not working. I've had this situation once where my monitor took just long enough to adjust the display resolution, so I couldn't see what was happening right at the start of the simulation. That way it seemed nothing had happened while it actually had. I'm just saying this, because I noticed you translate the compound object along the Z axis. If Z is up in your sim, the object would fall down again. Is it possible you missed that?

Just an off-chance guess here ;) Anyway, if I find out more about this, I'll keep you posted.
Greets,
Mark

> thanks for the code to combing multiple geoms. but i have some other problems 
> now. the body constisting of multiple geoms seems to be inactive somehow. the 
> position of its center of mass is fixed at (0,0,0). even a dSetBodyPosition 
> does not change anything.
> 
> thats what i do:
> i have 3 geoms, that should be combine and attached to F4_body
> 
> //number of geoms
> F4_numObjects=3;
> //buffer for geoms
> F4_geoms=new dGeomID[F4_numObjects];
> //buffer for masses
> F4_masses=new dMass[F4_numObjects];
> //fill the masses buffer
> dMassSetBox 
> (&F4_masses[0],DENSITY,baseplate_sizex,baseplate_sizey,baseplate_sizez);
>     dMassAdjust (&F4_masses[0],baseplate_mass);
>     dMassSetBox 
> (&F4_masses[1],DENSITY,bar_front_right_vertical_sizex,bar_front_right_vertical_sizey,bar_front_right_vertical_sizez);
>     dMassAdjust (&F4_masses[1],bar_front_right_vertical_mass);
>     dMassSetBox 
> (&F4_masses[2],DENSITY,bar_front_left_vertical_sizex,bar_front_left_vertical_sizey,bar_front_left_vertical_sizez);
>     dMassAdjust (&F4_masses[2],bar_front_left_vertical_mass);
> 
> //buffer for positions
>     F4_positions=new dVector3[F4_numObjects];
> //fill the positions buffer
>     F4_positions[0][0]=baseplate_posx;
>     F4_positions[0][1]=baseplate_posy;
>     F4_positions[0][2]=baseplate_posz;
>     F4_positions[1][0]=bar_front_right_vertical_posx;
>     F4_positions[1][1]=bar_front_right_vertical_posy;
>     F4_positions[1][2]=bar_front_right_vertical_posz;
>     F4_positions[2][0]=bar_front_left_vertical_posx;
>     F4_positions[2][1]=bar_front_left_vertical_posy;
>     F4_positions[2][2]=bar_front_left_vertical_posz;
> 
> //buffer for rotations
>     F4_rotations=new dMatrix3[F4_numObjects];
> //fill the rotations buffer
>     for(int i=0;i<F4_numObjects;i++) dRSetIdentity(F4_rotations[i]);
> 
> //create the body
> F4_body = dBodyCreate (*world);
> //create the geoms
> F4_geoms[0]  = dCreateBox (0,baseplate_sizex,baseplate_sizey,baseplate_sizez);
> F4_geoms[1]  = dCreateBox
> (0,bar_front_right_vertical_sizex,bar_front_right_vertical_sizey,bar_front_right_vertical_sizez);
> F4_geoms[2]  = dCreateBox 
> (0,bar_front_left_vertical_sizex,bar_front_left_vertical_sizey,bar_front_left_vertical_sizez);
> 
> //marks function    
> compoundGeom(F4_body,0,F4_numObjects,F4_geoms,F4_masses,F4_positions,F4_rotations);
> 
> //change the position of the body, nothing happens!!!!!!!!!!!!!!!!!!!
> dBodySetPosition(F4_body,0,0,10);
> 
> any suggestions?
> 
> c.
> 
> Am Mittwoch, 12. März 2003 20:33 schrieb skjold@cistron.nl:
> > A minor correction to the code in my previous post:
> >
> > The variable name lSimpleSpaceID is used inside the first for-loop. It
> > should actually be lSpaceID, which is declared just above that loop.
> > Alternatively, if you don't want to put the geom into a new space anyway,
> > you can just replace it with aSpaceID.
> >
> > Greets,
> > Mark
> > _______________________________________________
> > ODE mailing list
> > ODE@q12.org
> > http://q12.org/mailman/listinfo/ode
> 
> -- 
> -__________________________________________
> Dr. rer. nat. Dipl.-Phys. C. Verbeek
> email: christian.verbeek@ais.fraunhofer.de
> room: C2-214
> http://www.ais.fraunhofer.de/~verbeek
> phone: +49 2241 14 2057
> fax  : +49 2241 14 2384
> 
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>