[ODE] Using dMultiply0 with drawstuff?

J. Perkins jason at 379.com
Wed Dec 12 12:05:02 2001


I've found that if I call dMultiply0() while in the drawStuff
simLoop() function, the app appears to go off into a loop
somewhere - all it renders is a white screen, and when I try
to close the app, there's a pause and then a message box
with "unable to close rendering thread". Commenting out the
dMultiply0() causes the app to function normally. Here's
more details:


I have a situation where I have a collision sphere contained in
a GeomTransform:

   dGeomID sphere = dCreateSphere(0, radius);
   dGeomID xform  = dCreateGeomTransform(space);
   dGeomTransformSetGeom(xform, sphere);
   dGeomSetBody(xform, body);

   dGeomSetPosition(sphere, x, y, z);
   dGeomSetRotation(sphere, r);


Now in simLoop(), I want to draw something at the location of
the sphere geometry, so I get the position of the xform and
the sphere:

   const dReal* xformPos  = dGeomGetPosition(xform);
   const dReal* xformRot  = dGeomGetRotation(xform);
   const dReal* spherePos = dGeomGetPosition(sphere);

Everything looks good, now I try to convert the sphere's
position to world space by doing this:

   dVector3 worldPos;
   dMultiply0(worldPos, xformRot, spherePos, 3, 1, 3);
   worldPos[0] += xformPos[0];
   worldPos[1] += xformPos[1];
   worldPos[2] += xformPos[2];

When I do this, I get a white screen - simLoop() gets called
*once*, and that's it. If I try to exit the program, there's
a pause and I get a message about "unable to kill rendering
thread". Breaking the program execution in the debugger
invariably sticks me in the drawstuff message processing
loop - not real useful. If I comment out the dMultiply0(),
everything works fine.

Any ideas? I have a drawstuff example that I can send, but
it's a bit long so I didn't want to put it on the list.

Jason
379