POV-Ray : Newsgroups : povray.general : Warping an Isosurface Server Time
7 Nov 2024 09:29:53 EST (-0500)
  Warping an Isosurface (Message 1 to 3 of 3)  
From: Dave Matthews
Subject: Warping an Isosurface
Date: 10 Oct 2003 11:00:03
Message: <web.3f86c7b410a16da310dd5cfd0@news.povray.org>
I'm not sure that this discovery adds much to the stockpile of useful POVRay
techniques, but I thought I'd share it anyway.

I wanted to directly warp an isosurface -- not add or subtract a noise
function, but apply the "black_hole," "turbulence," etc. to the isosurface
function itself.

By going through Mike Williams' "Isosurface Tutorial,"
http://www.econym.demon.co.uk/isotut/index.htm, I came up with the
following (but don't blame him if I missed some incredibly easy method of
doing the same thing):

Use the function in question as a pigment, but run it through a "high-low"
filter, so that it doesn't repeat itself for values >1 and < -1.  If the
function has a threshold of 0, I do this:

#declare My_F = function { stuff };

#declare Warped_F =
            function {
              pigment {
                 function {min(max(-0.5, My_F(x,y,z)),0.5) + 0.5}
                 warp { warping stuff }
                      }
                     };

isosurface { function { Warped_F(x,y,z).gray - 0.5 }
             threshold 0
             other isosurface stuff
            }

Depending on the function, sometimes I've had to use "0.5 -
Warped_F(x,y,z).gray" .

Question:  Is there an easier way of directly "warping" an isosurface?

Question #2 (I'll answer this):  Why not just add/subtract a pigment?
(Answer:  I don't know.  Maybe I'm just being difficult.)


Post a reply to this message

From: Dave Matthews
Subject: Re: Warping an Isosurface
Date: 10 Oct 2003 11:15:03
Message: <web.3f86cbdb9d384b0210dd5cfd0@news.povray.org>
Dave Matthews wrote:
>I'm not sure that this discovery adds much to the stockpile of useful POVRay
>techniques, but I thought I'd share it anyway.
>
>I wanted to directly warp an isosurface -- not add or subtract a noise
>function, but apply the "black_hole," "turbulence," etc. to the isosurface
>function itself.
>
>By going through Mike Williams' "Isosurface Tutorial,"
>http://www.econym.demon.co.uk/isotut/index.htm, I came up with the
>following (but don't blame him if I missed some incredibly easy method of
>doing the same thing):
>
>Use the function in question as a pigment, but run it through a "high-low"
>filter, so that it doesn't repeat itself for values >1 and < -1.  If the
>function has a threshold of 0, I do this:
>
>#declare My_F = function { stuff };
>
>#declare Warped_F =
>            function {
>              pigment {
>                 function {min(max(-0.5, My_F(x,y,z)),0.5) + 0.5}
>                 warp { warping stuff }
>                      }
>                     };
>
>isosurface { function { Warped_F(x,y,z).gray - 0.5 }
>             threshold 0
>             other isosurface stuff
>            }
>
>Depending on the function, sometimes I've had to use "0.5 -
>Warped_F(x,y,z).gray" .
>
>Question:  Is there an easier way of directly "warping" an isosurface?
>
>Question #2 (I'll answer this):  Why not just add/subtract a pigment?
>(Answer:  I don't know.  Maybe I'm just being difficult.)
>

OK, now I see that I could simply use "pattern" instead of "pigment" and not
need the .gray at all.

(Don't know how I missed this, it's right in Mike Williams' tutorial.)


Post a reply to this message

From: David Burnett
Subject: Re: Warping an Isosurface
Date: 10 Oct 2003 13:35:44
Message: <3f86edf0$1@news.povray.org>
Dave Matthews wrote:
> I'm not sure that this discovery adds much to the stockpile of useful POVRay
> techniques, but I thought I'd share it anyway.
> 

One of the fun things I do is to warp the isosurfaces
by d multiplying (adding etc)
the co-ordinates by another function. e.g.

f_wrinkles(x * f_wrinkles(x,y,z),
            y * f_wrinkles(x,y,z),
            z * f_wrinkles(x,y,z))

Its more flexible than plain warping, but slow
at least until someone patches warping to take functions :-)

Dave


Post a reply to this message

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