POV-Ray : Newsgroups : povray.newusers : Spline : Re: Spline Server Time
29 Jul 2024 16:31:00 EDT (-0400)
  Re: Spline  
From: Oleguer Vilella
Date: 22 Jun 2005 03:04:35
Message: <42b90d83$1@news.povray.org>
Well I was playing with splines using them as a function and I think I 
understood them.
Now I'm going to try to to do another thing.

Thank you very much for your help and for your quick relpy.

Best regards,
Oleguer




news:OOe### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
>>I want a function to make
>>the surface go up and go down. I think a spline would be a good idea.
>>
>>What do you think Mike?
>
> Perhaps something like this:
>
>
> #version 3.6;
>
> global_settings {assumed_gamma 1.0}
>
> camera {location  <0,50,-160> look_at <0,0,0>}
>
> background {rgb 1}
>
> light_source {<-30, 100, -30> color rgb 1}
>
> // ----------------------------------------
>
> #include "colors.inc"
>
> #declare S = function {
>   spline {
>     linear_spline
>    -1.0, < 0.5, 0, 0>,
>    -0.5, < 0,   0, 0>,
>     0.01,< 0.2, 0, 0>,
>     0.5, <-0.2, 0, 0>,
>     1, <-0.2, 0, 0>
>   }
> }
>
> #declare Length = 100;
> #declare Height = 50;
> #declare Thickness = 10;
>
> #declare  Q = function {y - Height*S(x/Length).x}
>
> isosurface {
> function { abs(Q(x,y,z)) - Thickness  }
>  max_gradient 2
>  contained_by{box{ -<Length, Height+Thickness, Thickness>
>                     <Length, Height+Thickness, Thickness> }}
>  pigment { color Green}
>  finish { ambient 0.2 diffuse 0.8 phong 1 }
> }
>
>
> This is rigged for the container box to just fit as long as the spline
> values stay between -1.0 and +1.0.
>
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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