POV-Ray : Newsgroups : povray.general : Using bezier_spline : Using bezier_spline Server Time
16 Apr 2024 02:56:42 EDT (-0400)
  Using bezier_spline  
From: Kima
Date: 23 May 2018 18:30:00
Message: <web.5b05ea92c0e42ed13ce674f0@news.povray.org>
I draw a curvy line with spline in POVRAY as

camera {location <0,15,5> look_at <0,0,0>}
light_source {<0,5,12> color rgb<1,1,1>}
background {color rgb<1,1,1> }

#declare Spline_1 =
  spline {
   cubic_spline
  -.2, <-5,1.0,-5>,
   .1, <-4,1.0,-2>,
   .2, <-3,1.0,3.5>,
   .3, <-2,1.0,2>,
   .4, <-1,1.0,-1>,
   .5, <0,1.0,0>,
   .6, <1,1.0,1>,
   .7, <2,1.0,0>,
   .8, <3,1.0,1>,
   .9, <4,1.0,0>,
   1.0, <5,1.0,3>,
   1.2, < 6,1.0,5>
  }

 #declare Nr = 0;
 #while (Nr<1)
 sphere{ <0,0,0>,0.27
          texture{ pigment{color rgb <1-Nr/2,0.75+Nr/4,1>}
                  finish {diffuse 0.9 phong 1}
                }
        #declare Tr = Nr * 3;
         translate Spline_1(Nr)
       }

 #declare Nr = Nr + 0.001;
 #end


but bezier_spline is a better option for this sort of curves. However, the usage
of bezier_spline and its controller points is not very clear from the povray
documentation.

How can I use bezier_spline in this example?


Post a reply to this message

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