POV-Ray : Newsgroups : povray.general : Minimum Distance Function : Re: Minimum Distance Function Server Time
28 Mar 2024 05:02:59 EDT (-0400)
  Re: Minimum Distance Function  
From: jceddy
Date: 12 Jul 2022 10:00:00
Message: <web.62cd7d6f6fb4e448864166f75d51d79c@news.povray.org>
> FYI. A chance the following inside_vector issue in play.
>
> "Leaving mesh inside_vector untouched on transforms."
> https://github.com/POV-Ray/povray/pull/361
>

That merge request changes the inside_vector test to use MInvTransPoint instead
of MInvTransRay followed by a Normalize, which makes sense to me.

In the version where I don't transform the mesh vertex data, I am doing
MInvTransPoint to tranform the test point, computing the minimum distance Vector
from the transformed test point to the original mesh data, then using
MInvTransDirection to transform that Vector using the mesh's Trans, then using
the length of the transformed vector as the distance.

The result obtained this way is a lot worse.

I wonder if there are cases where it would actually get a *wrong* answer, not
just loss of precision...such as the case where the object is scaled
non-uniformly. I think you can come up with an easy example where this is the
case where a "fat" ellipse that has a larger diameter in the x/y plane is scaled
such that it has a larger diameter in the x/z plane. Looking at the point at the
center of the ellipse, the minimum distance direction vector would switch from
<1, 0, 0> to <0, 1, 0> (for example).


Post a reply to this message

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