POV-Ray : Newsgroups : povray.binaries.images : Cubic splines in megapatch, order of points matters? : Cubic splines in megapatch, order of points matters? Server Time
20 Aug 2024 00:18:09 EDT (-0400)
  Cubic splines in megapatch, order of points matters?  
From: Greg M  Johnson
Date: 26 Sep 2000 21:08:34
Message: <39d14892@news.povray.org>
I'm wondering why these two curves are different.  They are splines
rftpt  &  lftpt .
They both have essentially the same points, but one dips at a different
time than the other. I end up losing all of my "cubicness".


#version unofficial MegaPov 0.4;
#include "colors.inc"
#include "skies.inc"

camera {location <25,-17, 0> look_at <0,-17, 0>
        angle 60}

light_source { <-15, 30, -25> color red 1 green 1 blue 1 }
light_source { < 15, 30, -25> color red 1 green 1 blue 1 }
light_source { < -1, 1, 10> color red 1 green 1 blue 1 }
light_source { < 0, 1, 0> color red 1 green 1 blue 1 }


  #declare texy=texture {
    finish {
      ambient 0.3
      diffuse 0.8
      phong 1
    }
    normal {
      bumps 0.4
      sine_wave
      scale 0.08
    }
    pigment { color Red }

}

#init_3d_spline {"My_Spline",closed
                            #declare c=0;
                            #while (c<1.001)
                               ,<2*sin(15*c),c*3,2*cos(15*c)>
                               #declare c=c+0.05;
                            #end
                            }

           //translate <0,-4.3,-1>

#declare lftpt=
        spline {
        //linear_spline
        cubic_spline
        0.00, <0,-17,-7>
        0.50, <0,-17, 7>
        0.75, <0,-10,-0>
        1.00, <0,-17,-7>
}

#declare rftpt=
        spline {
        //linear_spline
        cubic_spline
        0.00, <0,-17, 7>
        0.25, <0,-10,-0>
        0.50, <0,-17,-7>
        1.00, <0,-17, 7>
}



  #declare c=0;
  #while (c<1)

   sphere { rftpt(c),0.2 texture {texy}}
   sphere { lftpt(c),0.2 texture {texy}}

   #declare c=c+0.008;

  #end


Post a reply to this message


Attachments:
Download '5.jpg' (9 KB)

Preview of image '5.jpg'
5.jpg


 

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