POV-Ray : Newsgroups : povray.advanced-users : struggle with splines : struggle with splines Server Time
6 Oct 2024 12:56:56 EDT (-0400)
  struggle with splines  
From: Chrisir
Date: 3 Oct 2006 17:20:00
Message: <web.4522d3275cb1df97a9bd07600@news.povray.org>
Hello!

I am just struggling with splines here.
I have one spline then should go from P1
to P2 (exactly), being modified by M1, M2 and M3.

How can I make positively sure that my spline starts exactly
always and definetly in P1 and ends exactly
always and definetly in P2?

I build the thing for various reasons as a macro.
I start MySphere1, which uses MSpline.

Please help.

Thanks!

Yours sincerely,

Chris




#macro MSpline(P1,P2,M1,M2,M3)

// defines Spline

  #declare MSpline1 = spline {
    cubic_spline
    -1,M1
     0,P1
     0.5,M2
     1,P2
     2,M3
  }
#end  // end of macro

#macro MySphere1(P1,c1,P2,c2,M1,M2,M3) // c1 and c2 is for color.

        // uses spline MSpline

        #declare SphereRadius = 0.02;
        #declare ctr = 0;

        MSpline(P1,P2,M1,M2,M3);

        #while (ctr < 1)
        sphere {
            MSpline1(ctr), SphereRadius
            pigment { rgb c1 }
          }
          #declare ctr = ctr + 0.01;
        #end   // end of while

#end  // end of macro


Post a reply to this message

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