POV-Ray : Newsgroups : povray.general : How to use a bezier curve in cubic_spline? : How to use a bezier curve in cubic_spline? Server Time
25 Apr 2024 17:37:04 EDT (-0400)
  How to use a bezier curve in cubic_spline?  
From: Kima
Date: 31 Jan 2020 21:15:00
Message: <web.5e34de506de648e8ecc0fada0@news.povray.org>
In cubic_spline, the beginning and end points are control points, which are
similar to those of a bezier curve. If we take a bezier curve of a semi-circle
with a set of

<-3,0,0>,<-3,4,0>,<3,4,0>,<3,0,0>

The second and third points are the handles, which can be used in a spline as

#declare MySpline =
  spline {
    cubic_spline
    -.25, <-3,4,0> // 2nd point of bezier
    0, <-3,0,0> // 1st point of bezier
    1, <3,0,0> // 4th point of bezier
    1.25, <3,4,0> // 3rd point of bezier
  }

#declare ctr = 0;
#while (ctr < 1)
  sphere {
    MySpline(ctr),.25
    pigment { rgb <1-ctr,ctr,0> }
  }
  #declare ctr = ctr + 0.01;
#end

but it does not work, because I have no mechanism for setting/adjusting the
spline values.


Post a reply to this message

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