POV-Ray : Newsgroups : povray.advanced-users : isosurface surface normals : Re: not trace Server Time
10 May 2024 12:32:51 EDT (-0400)
  Re: not trace  
From: Mike Williams
Date: 25 Dec 2001 15:02:51
Message: <SGZzeLAFsNK8EwKe@econym.demon.co.uk>
Wasn't it Barron Gillon who wrote:
>not trace!  I need to find the normal at an arbitrary point that
>_may_or_may_not be on the surface.  Trace finds an intersection with a
>surface and then returns the normal at the intersection, but I need the
>normal from an arbitrary point given an arbitrary function.  Trace is good,
>but not quite what I'm looking for.  Thanks anyway.

Actually you can still use "trace()". What you have to do is declare a
temporary isosurface which is the same as the original one, but has a
different value of "threshold". The value of "threshold" to use is the
value of the function at the point you are interested in.

E.g. suppose you have an arbitrary function F(x,y,z) and you want to
find the "normal" at the point P, then you can temporarily declare

#declare Temp =
isosurface {function {F(x,y,z)}
        threshold F(P.x,P.y,P.z)
        ...
        }

and perform a "trace()" on that.

[We know that the function evaluates to F(P.x,P.y,P.z) at the point P,
and the Temp isosurface is the set of all points for which the function
evaluates to that value, so the Temp isosurface contains the point P]

Since we don't ever render the Temp isosurfaces, they shouldn't pose too
much of a processing overhead.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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