[ODE] TriMesh

Jon Watte (ODE) hplus-ode at mindcontrol.org
Fri Aug 19 13:48:00 MST 2005


That's not true, as you can just move the collider instead. Using a 
dGeomTransform on a trimesh should work just fine, for example.

Cheers,

			/ h+


kurimail wrote:
>>From what i remember, you can't move the trimesh after the creation of the
> data...
> 
> 
>>Question 1: Does your Tri Mesh have a body associated with it, if not then
>>it will never get in your loop.
>>Question 2: How many contacts are being generated in the loop. Does the
>>object just fall or does it interwine and fall?
>>
>>Thanks,
>>Gopi
>>
>>-----Original Message-----
>>From: TongKe Xue [mailto:tongke at gmail.com]
>>Sent: Wednesday, August 17, 2005 2:30 PM
>>To: ode at q12.org
>>Subject: [ODE] TriMesh
>>
>>
>>Hi,
>>
>>  I have this serpentine robot I'm simulating in ODE. It's just a
>>bunch of boxes connected together by hinges. I'm having some problems
>>with having it stay on tri-meshes (as opposed to falling through).
>>
>>My nearCallbackk looks like:
>>
>>void nearCallback (void *data, dGeomID o1, dGeomID o2)
>>{
>>  int i,n;
>>
>>  dBodyID b1 = dGeomGetBody(o1);
>>  dBodyID b2 = dGeomGetBody(o2);
>>
>>  if (b1 && b2 && dAreConnectedExcluding(b1, b2, dJointTypeContact))
>>    return;
>>
>>  const int N = 10;
>>  dContact contact[N];
>>  n = dCollide (o1,o2,N,&contact[0].geom,sizeof(dContact));
>>  if (n > 0) {
>>    for (i=0; i<n; i++) {
>>      contact[i].surface.mode = dContactSoftERP | dContactSoftCFM|
>>dContactApprox1;
>>      //contact[i].surface.mode = dContactSlip1 | dContactSlip2 |
>>dContactSoftERP | dContactSoftCFM| dContactApprox1;
>>      contact[i].surface.mu = dInfinity;
>>      contact[i].surface.soft_erp = 0.2;
>>      contact[i].surface.soft_cfm = 0.001;
>>      contact[i].surface.bounce = 0.01;
>>      dJointID c = dJointCreateContact (G_simul_world,
>>G_simul_contactgroup, contact+i);
>>      dJointAttach (c,b1,b2);
>>    }
>>  }
>>}
>>
>>
>>  What works:
>>    * snake robot does NOT fall through the floor (dPlane)
>>    * snake robot does NOt fall through boxes (dBox)
>>
>>  However, now that I play with tri-meshes, I have the following problem:
>>    * in some positions (like 0, 0, 0) if I drop the snake, it lands
>>      on the trimesh, takes it's contour, and everything is good.
>>    * however, if I move the tri-mesh around a bit, using
>>      dGeomSetPosition, the snake will fall right through the trimesh
>>
>>  The entire trimesh is constructed in the same way, as follows:
>>
>>  for(int i=0; i<width; ++i)
>>    for(int j=0; j<length; ++j)
>>      locs[i][j] = some_random_value();
>>  smooth(locs, window, iterations);
>>
>>  for(int i=0; i<width; ++i)
>>    for(int j=0; j<length; ++j) {
>>      vertex[i*length+j][0]=i;
>>      vertex[i*length+j][1]=j;
>>      vertex[i*length+j][2]=locs[i][j];
>>    }
>>
>>  // and then I construct triangles for the following pairs:
>>
>>  (i, j) (i, j+1), (i+1, j)
>>     and
>>  (i+1, j) (i, j+1), (i+1, j+1)
>>
>>  for i<width-1; j<length-1;
>>
>>  // basically, I create a grid, and chop each square into two
>>  // triangles
>>
>>  this Trimesh also displays properly in ODE
>>
>>  things I've tried:
>>  * tuning the step size down to 0.001 (for time step size)
>>  * tuning the CFM down to 0.000001
>>
>>  neither of which helped
>>
>>
>>
>>  Any ideas what might be going on?
>>
>>Thanks,
>>--TongKe
>>
>>_______________________________________________
>>ODE mailing list
>>ODE at q12.org
>>http://q12.org/mailman/listinfo/ode
>>_______________________________________________
>>ODE mailing list
>>ODE at q12.org
>>http://q12.org/mailman/listinfo/ode
>>
> 
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 


More information about the ODE mailing list