POV-Ray : Newsgroups : povray.programming : gradient Server Time
23 Dec 2024 07:06:26 EST (-0500)
  gradient (Message 1 to 4 of 4)  
From: Thomas Willhalm
Subject: gradient
Date: 2 Dec 2002 11:45:46
Message: <3deb8e39@news.povray.org>
Hello,

if I remember correctly, I came across some code in povray or one of its
patches that calculates the gradient of a pattern or function. By this
I mean a function that numerically finds the direction of a real valued
function f at some point p in space in which f increases most. This was 
done by evaluating the function slightly off p. To improve numerical 
stability, the code in question used the four vertices of a tetrahedron 
and evaluated the function f there. So, if v1,...,v4 denote the vertices
of a tetrahedron centered at the origin, the function f was evaluated at
p+v1, p+v2, p+v3 and p+v4.

Unfortunately I cannot find this code anymore. Does somebody know what
I'm writing about and the file to look at?

Thanks in advance.
Thomas


Post a reply to this message

From: Christoph Hormann
Subject: Re: gradient
Date: 2 Dec 2002 12:02:55
Message: <3DEB923F.58AEAF86@gmx.de>
Thomas Willhalm wrote:
> 
> Hello,
> 
> if I remember correctly, I came across some code in povray or one of its
> patches that calculates the gradient of a pattern or function. By this
> I mean a function that numerically finds the direction of a real valued
> function f at some point p in space in which f increases most. This was
> done by evaluating the function slightly off p. To improve numerical
> stability, the code in question used the four vertices of a tetrahedron
> and evaluated the function f there. So, if v1,...,v4 denote the vertices
> of a tetrahedron centered at the origin, the function f was evaluated at
> p+v1, p+v2, p+v3 and p+v4.
> 
> Unfortunately I cannot find this code anymore. Does somebody know what
> I'm writing about and the file to look at?

You have some POV-SDL based macros for gradient calculation in
'math.inc'.  Apart from that the isosurface normal calculation code does
something similar too, function 'IsoSurface_Normal()' in 'isosurf.cpp'.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 15 Nov. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thomas Willhalm
Subject: Re: gradient
Date: 3 Dec 2002 02:57:34
Message: <3dec63ed@news.povray.org>
Christoph Hormann wrote:
> 
> Thomas Willhalm wrote:
>> 
>> Hello,
>> 
>> if I remember correctly, I came across some code in povray or one of its
>> patches that calculates the gradient of a pattern or function. By this
>> I mean a function that numerically finds the direction of a real valued
>> function f at some point p in space in which f increases most. This was
>> done by evaluating the function slightly off p. To improve numerical
>> stability, the code in question used the four vertices of a tetrahedron
>> and evaluated the function f there. So, if v1,...,v4 denote the vertices
>> of a tetrahedron centered at the origin, the function f was evaluated at
>> p+v1, p+v2, p+v3 and p+v4.
>> 
>> Unfortunately I cannot find this code anymore. Does somebody know what
>> I'm writing about and the file to look at?
> 
> You have some POV-SDL based macros for gradient calculation in
> 'math.inc'.  Apart from that the isosurface normal calculation code does
> something similar too, function 'IsoSurface_Normal()' in 'isosurf.cpp'.

Thanks, this function does what I want, although it's not the function
I vaguely remember. Perhaps it was in a different program, but I have 
no clue what program this should be.

Thanks again
Thomas


Post a reply to this message

From: Peter Popov
Subject: Re: gradient
Date: 3 Dec 2002 06:29:18
Message: <ra5puuse9or3trqbfj8pv2dvantu8d4t4s@4ax.com>
On Tue, 03 Dec 2002 08:57:21 +0100, Thomas Willhalm
<tho### [at] uni-konstanzde> wrote:

>>> Unfortunately I cannot find this code anymore. Does somebody know what
>>> I'm writing about and the file to look at?

I think the julia_fractal and blob objects use similar approaches to
calculating the normal (aside from the isosurface code Christoph
mentioned).


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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