POV-Ray : Newsgroups : povray.general : Minimum Distance Function : Re: Minimum Distance Function Server Time
25 Apr 2024 01:04:03 EDT (-0400)
  Re: Minimum Distance Function  
From: jceddy
Date: 10 Jul 2022 15:30:00
Message: <web.62cb280b6fb4e448864166f75d51d79c@news.povray.org>
> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.