|
|
> The next thing will be handling transformations...I realized this morning that I
> can't just apply an inverse transform to the point being tested...this won't
> work for scale and shear transformations. I think I will need to actually
> generate and cache a version of the mesh data with the object transformations
> applied, and then use THAT mesh data for calculating minimum distance.
>
So I got the code to calculated minimum distance using nearest-vertex from a
kd-tree working. At least I think so...I have some tiny artefacts that I think
might be a result of a bug in the code, but might also just be a result of the
kinds of tolerance issues that were mentioned above.
I added code to the underlying Mesh object in povray for calculating a
transformed copy of the vertex data, and verified that that seems to be
working...but now thinking there might be an easier solution. Like...
Can I inverse-transform the point being tested, run the minimum-distance
calculation against the original data to get a minimum-distance *VECTOR* from
the test point to the original mesh, then just apply the object's transformation
matrix to that vector before measuring its length?
Post a reply to this message
|
|