POV-Ray : Newsgroups : povray.general : Spline vector function : Re: Spline vector function Server Time
26 Apr 2024 01:27:30 EDT (-0400)
  Re: Spline vector function  
From: Alain
Date: 20 Nov 2016 17:30:07
Message: <583223ef@news.povray.org>

> I am experimenting with this:
> #version 3.7 ;
>   global_settings {assumed_gamma 1.0 }
>
>     camera {location <-10,40,-40> angle 4 look_at <0,0,0> }
>     light_source {<-5,20,-20> colour rgb<1,1,1>}
>   background { color rgb<0.2, 0.4, 0.8>  }
>
>
> #declare Place = function {
>   spline {
>     linear_spline
> //    -4, <-10,0,-2>
>     -2, <0,0,-1>
>     0, <1,0,0>
>     2.0, <0,1,1>
>     }
>   }
>  sphere {Place(-1),.1 pigment {color rgb < 1, 0, 0>}}
>  sphere {Place(-.5),.1pigment {color rgb < 1, 1, 0>} }
>  sphere {Place(-0),.1 pigment {color rgb < 0, 1, 0>}}
>  sphere {Place(+.5),.1 pigment {color rgb < 1, 0, 1>}}
>  sphere {Place(+1),.1 pigment {color rgb < 0, 0, 1>}}
>
> This seems to work but if I add another point by deleting the // I get an error
> which does not make sense (to me).
>
> Should it be possible to do arbitarily long bezier splines?
>
>

You should add some comas in your points list. Your second component is 
starting with -2. This cause the whole statement to be interpreted as:
-4, <-10,0,-2>-2, <0,0,-1>,...
whitch becomes:
-4, <-12, -2, -4>, <0,0,1>,...

Remember, spaces, tabs and new lines/cariage returns et NOT terminal 
separators.

Alain


Post a reply to this message

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