Thanks for this response. Your method is slick, but is it necessary ? I'm
thinking that this would do the same as I'm doing by saving the original
positions under a new component name, and then grabbing that component from the
pick. ??

But there is something that is being overlooked in all my postings on this -
since the "pick" is an interpolated point, with whatever method you use to get
back to world coordinates, those world coordinates are then interpolated too.
Neither of these methods can be used on the closest true data point, because
this point can only (I think) be found by extracting "closest vertex", which
returns a vector, not a field.

Maybe I'm making too much of this idea that it is necessary to get an existing
data point from the pick, not just an interpolated point. Does it really matter
?? No one else seems to get hung up on it.

On Mar 21, 12:43pm, Mike Zeleznik wrote:
> Subject: Re: [opendx-users] picking from transformed object
> | 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?
>-- End of excerpt from Mike Zeleznik

Reply via email to