POV-Ray : Newsgroups : povray.advanced-users : gradient ? : Re: gradient ? Server Time
29 Jul 2024 14:19:10 EDT (-0400)
  Re: gradient ?  
From: Christoph Hormann
Date: 20 Jan 2002 12:12:51
Message: <3C4AFA87.59C54FFB@gmx.de>
Jan Walzer wrote:
> 
> [...]
> Therefore my question, if there is one macro out there (somewhere), and if it
> would be possible,
> to include it into functions.inc for one of the following versions ...
> 

For the length of the gradient try the following:

function {
  sqrt(
    (fn_test(x+DELTA, y, z) - fn_test(x, y, z))^2+
    (fn_test(x, y+DELTA, z) - fn_test(x, y, z))^2+
    (fn_test(x, y, z+DELTA) - fn_test(x, y, z))^2
  )/DELTA
}

Note that Povray right now does not optimize the multiple 'fn_test(x, y,
z)' so there are in fact 6 function evaluations.  

I will see what i can do concerning inclusion of such things into the
include files.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

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