POV-Ray : Newsgroups : povray.advanced-users : gradient ? : Re: gradient ? Server Time
29 Jul 2024 14:25:28 EDT (-0400)
  Re: gradient ?  
From: Tor Olav Kristensen
Date: 20 Jan 2002 12:31:54
Message: <3C4AFE75.84074F9D@hotmail.com>
Jan Walzer wrote:
> 
> We have trace(), to find the intersection and the normal of any CSG-Object
> with rays ...
> Also we can compute the value of any 3D-Pattern at a given 3D-Point ...
> 
> What I'm missing, is the ability to compute the gradient of a 3D-Pattern at a
> given point.
> 
> I know, this is not possible for avery pattern on every point ...
> 
> But (concerning Isosurfaces) it's done internally in POV...
> I know, its done numerically, and depends on a given accuracy ...
> 
> I know, I can do this with a macro (is there one out there ?), taking 4
> sample points(depending on accuracy)
> around the point in question, and applying some maths to them, and one should
> get a vector, showing the
> gradient...
> 
> My question: Do you see any chance, that we can access the internal (faster)
> gradient-function of POV
> as it is probably the case for trace(), or at least a simple macro (doing
> this in SDL-Space) that comes
> with functions.inc in Pov3.5 ? ...
> 
> I know, it sounds like a feature-request, but there's probably such a macro
> already out there, and
> it wouldn't hurt, to put it into functions.inc, would it ?

I agree very much with you Jan, it would be very nice
to have a built-in function that would return the
numerically calculated gradient vector for 3D functions
at any point in 3D-space.

If you look into my reply to Barron Gillon's
post to this group 24. Dec. 2001;
"isosurface surface normals",
you'll find such a macro: vGradient()

http://news.povray.org/povray.advanced-users/20922/138919/
news://news.povray.org/3C292BC5.5A6AB4A6%40hotmail.com


Example usage:

#declare WrinkleFn = function { pattern { wrinkles } }

#declare vWrinkleGradient =
vGradient(
  function { WrinkleFn(x, y, z) },
  <3, -2, 1>
)

If you have a closer look at this macro, you'll
probably notice its similarities to the three
functions DerxFn(), DeryFn() and DerzFn() in
my reply to your post 12. Nov. 2001:
"Help on isosurface - distances - other stuff..."

http://news.povray.org/povray.advanced-users/19992/130234
news://news.povray.org/3BF0541A.62BC8C1F%40hotmail.com


Tor Olav


Post a reply to this message

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