POV-Ray : Newsgroups : povray.advanced-users : spline question : Re: spline question Server Time
28 Jul 2024 10:23:14 EDT (-0400)
  Re: spline question  
From: Mike Williams
Date: 6 May 2006 10:09:41
Message: <2dV+IAA13KXEFwVu@econym.demon.co.uk>
Wasn't it LEO_BOLOGNA who wrote:
>Mike Williams <nos### [at] econymdemoncouk> wrote:
>> In the third example on this page I
>> could just as well have used the x values from one spline and the z
>> values from a spline of a different type.
>>
>> http://www.econym.demon.co.uk/isotut/more.htm
>
>Ok I've read this page and I find it very interesting...but if I try to put
>this piece of code in a .pov file the result isn't similar to the image in
>this site...
>
>my pov file is:
>
>#include "colors.inc"
>
>camera {
>
>location <10, 10, -10>
>
>look_at <0, 0, 0>
>}
>light_source { <25, 25, -100> color rgb 1 }
>
>#declare S = function {
>   spline {
>     natural_spline
>      -1, < 0.5, 0, 0.0>,
>    -0.5, < 0.2, 0, 0.4>,
>    0.01, < 0.2, 0, 0.2>,
>     0.5, < 0.4, 0, 0.4>,
>       1, < 0.0, 0,-0.6>
>   }
> }
>
>isosurface {
>  function { y - S(x).x - S(z).z }
> contained_by { box { -10, 10 } }
> pigment{Red}
>}
>
>
>Have you got any idea?!?!

Your spline is only defined between -1 and +1, so in the regions outside
that, the spline evaluates to zero, so the isosurface is just {y - 0}
and you get a flat plane.

Either change to contained_by {box {-1,1}}
  and zoom in
  and increase your max_gradient to 2


Or use   function { y/10 - S(x/10).x - S(z/10).z }
  and decrease your max_gradient to 0.25


Or arrange for your spline to cover the whole of the region that you're
going to render
#declare S = function {
   spline {
     natural_spline
     -10, < 5, 0, 0>,
      -5, < 2, 0, 4>,
    0.01, < 2, 0, 2>,
       5, < 4, 0, 4>,
      10, < 0, 0,-6>
   }
 }
and increase your max_gradient to 2

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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