POV-Ray : Newsgroups : povray.beta-test : Beta29 isosurface badly broken : Re: Beta29 isosurface badly broken Server Time
28 Jul 2024 20:27:04 EDT (-0400)
  Re: Beta29 isosurface badly broken  
From: Slime
Date: 15 Nov 2008 14:24:46
Message: <491f21fe@news.povray.org>
> Damn I wish I knew what the hell you're talking about :) "gradient" to me 
> is
> a setting that has to be big enough for isosurfaces to work. I have no 
> idea
> what it really means...

Well, the gradient of a function at a point is a vector describing the 
function's greatest rate of change and the direction of that change. As a 
simple example, the gradient of f(x) = x is (1,0,0) everywhere, because it 
is always increasing in the x direction. Functions can have different 
gradients at different points. POV-Ray's max_gradient keyword is so you can 
supply the magnitude of the largest gradient anywhere in the function - or 
at least the part of the function within the bounding box - so that it knows 
the fastest the function can change. If POV-Ray evaluates a function and 
finds that its value is 2, and it knows its max_gradient is 1, then it knows 
it's safe to trace the ray 2 more units because it can't possibly find a 
zero value for the function within that distance - the function doesn't 
change fast enough for it to hit zero closer than that!

To actually find the gradient of a function at a point, you take the partial 
derivative with respect to each variable (x, y, and z), plug the values in 
for the point you want to evaluate, and make a vector out of it. The hard 
part is finding the place in the function with the largest vector. Once you 
have that vector, you just get the magnitude with sqrt(x*x+y*y+z*z). In 
reality, no one usually goes to this much trouble - they just make an 
educated guess and try to overestimate a little bit.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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