| How do you get original positions back out after picking from a transformed
| object and extracting the closest vertex ?

Maybe this is not what you need, but to get a picked point in a displayed
object back into the original world coordinates, just strip off the Xforms
on the object, catenate them, invert, and apply to the pick point.

 DXQueryPickPath(picks, poke, pick, &pathlen, &path, &elid, &vertid);
 current_picked_object = pdata->obj;
 mat = Identity;
 for (i=0; i < pathlen; i++) {
   current_picked_object = DXTraversePickPath(current_picked_object, path[i], 
&mat);
   if (! current_picked_object)  {
      return(-1);
    }
 }
 {
   Matrix mat_inv;
   double x, y, z;
   x = point.x;
   y = point.y;
   z = point.z;
   mat_inv = DXInvert(mat);
   MatRotate(mat_inv, &x, &y, &z);
   MatTranslate(mat_inv, &x, &y, &z);
   /* Now x,y,z are in original coordinates. */
 }

Or maybe I missed your entire point?

Reply via email to