POV-Ray : Newsgroups : povray.advanced-users : A New Isosurface question Server Time
28 Jul 2024 18:14:26 EDT (-0400)
  A New Isosurface question (Message 1 to 3 of 3)  
From: Rob Richards
Subject: A New Isosurface question
Date: 22 Oct 2004 08:15:50
Message: <4178f9f6$1@news.povray.org>
Hi,

I have the following code that generates a flat plane with steep sided
polygons.

-------------snip-------------
#declare f9=
function{
        pigment{
                crackle
                        color_map{
                                [0 Black]
                                [.3 Black]
                                [.4 White]
                                [1 White]
                                 }

               }
}
isosurface{
                function{y-f9(x/2,0,z/2).gray*2}
                ........
                }
-------------snip-------------

What I'd like to do is to make some cracks or holes in the steep sides of
the polygons. But I can't figure out how to do it ! Subtracting or adding
another function just seems to deform the flat parts of the surface.

Can anyone help ?

Cheers
Rob


Post a reply to this message

From: Mike Williams
Subject: Re: A New Isosurface question
Date: 22 Oct 2004 10:16:03
Message: <LGBBOFABLReBFw$X@econym.demon.co.uk>
Wasn't it Rob Richards who wrote:
>Hi,
>
>I have the following code that generates a flat plane with steep sided
>polygons.
>
>-------------snip-------------
>#declare f9=
>function{
>        pigment{
>                crackle
>                        color_map{
>                                [0 Black]
>                                [.3 Black]
>                                [.4 White]
>                                [1 White]
>                                 }
>
>               }
>}
>isosurface{
>                function{y-f9(x/2,0,z/2).gray*2}
>                ........
>                }
>-------------snip-------------
>
>What I'd like to do is to make some cracks or holes in the steep sides of
>the polygons. But I can't figure out how to do it ! Subtracting or adding
>another function just seems to deform the flat parts of the surface.
>

I can make holes everywhere, but restricting the holes to just the
vertical faces might be rather tricky.

#declare holes=function {pattern {leopard}} // or whatever

isosurface {
  function{max((y-f9(x/2,0,z/2).gray*2),holes(x*10,y*10,z*10)-0.45)}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Florian Brucker
Subject: Re: A New Isosurface question
Date: 22 Oct 2004 14:01:01
Message: <41794add@news.povray.org>
> Can anyone help ?
Just an untested idea: Use something like this:

F1 = your normal terrain function
F2 = same as F1, but returns 1 at the steep sides, 0 otherwise (should 
be doable by changing the color_map of F1)
F3 = your holes function

function { F1 - F2*F3 }

This will only apply the holes-function (F3) when the point is on a 
steep side (otherwise F2 will be zero -> F1 only).

HTH,
Florian
-- 
camera{look_at-y*10location<8,-3,-8>*10}#local a=0;#while(a<999)sphere{
#local _=.01*a-4.99;#local p=a*.01-5;#local c=.01*a-4.995;<sin(p*pi)*5p
*10pow(p,5)*.01>sin(c*c*c*.1)+1pigment{rgb 3}}#local a=a+1;#end
/******** http://www.torfbold.com ******** http://www.imp.org ********/


Post a reply to this message

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