POV-Ray : Newsgroups : povray.binaries.images : Cubic splines in megapatch, order of points matters? Server Time
20 Aug 2024 02:19:28 EDT (-0400)
  Cubic splines in megapatch, order of points matters? (Message 1 to 7 of 7)  
From: Greg M  Johnson
Subject: Cubic splines in megapatch, order of points matters?
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


 

From: John VanSickle
Subject: Re: Cubic splines in megapatch, order of points matters?
Date: 27 Sep 2000 07:53:57
Message: <39D1DFD2.545BE184@erols.com>
"Greg M. Johnson" wrote:
> 
> 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".

The order of the points in a spline matters no matter what software
you're using.

Regards,
John


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Cubic splines in megapatch, order of points matters?
Date: 27 Sep 2000 08:18:50
Message: <39D1E46B.CDB2D1A6@my-dejanews.com>
But do you get my point?

a,a,b,a  gives very different results from a,b,a,a

Shouldn't any a-b-a be the same?

John VanSickle wrote:

> "Greg M. Johnson" wrote:
> >
> > 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".
>
> The order of the points in a spline matters no matter what software
> you're using.
>
> Regards,
> John


Post a reply to this message

From: Quadhall
Subject: Re: Cubic splines in megapatch, order of points matters?
Date: 27 Sep 2000 11:13:26
Message: <39d20e96@news.povray.org>
Greg M. Johnson wrote in message <39D1E46B.CDB2D1A6@my-dejanews.com>...
......
>a,a,b,a  gives very different results from a,b,a,a
>
>Shouldn't any a-b-a be the same?


Not with cubic splines in general, as it requires FOUR control points to
determine the location of any point on the curve.  a-b-a does not give
sufficient information to determine a cubic spline curve.  As to what is
happening to your curve, check the documentation:

*Cubic splines can be calculated in the range between the second and last
but one argument. In the remaining parts linear splines are used.

This means that when you shift the control points, different types of
splines are being used between the same point locations, and thus different
appearances.  Thus you are actually only losing part of your "cubicness"
...the "cubicness" between the second and third points...when you change the
order number on your points (but gaining "cubicness" on the new second and
new third points).  I hope my explanation is clear enough to help......

Quadhall


Post a reply to this message

From: Spock
Subject: Re: Cubic splines in megapatch, order of points matters?
Date: 27 Sep 2000 11:26:46
Message: <39d211b6@news.povray.org>
Might be an idea to compare a,b,a,c with c,a,b,a.

I would suspect the a,b,a curve should be identical in both cases.

It might have been a typo, but I am pointing a suspicious finger at the
duplicate "a" in your sequence and suggesting you introduce a new point "c"
to test this theory.  Sorry I don't have a better way of expressing this.

I hope it works.

"Quadhall" <tre### [at] ww-interlinknet> wrote in message
news:39d20e96@news.povray.org...
>
> Greg M. Johnson wrote in message <39D1E46B.CDB2D1A6@my-dejanews.com>...
> ......
> >a,a,b,a  gives very different results from a,b,a,a
> >
> >Shouldn't any a-b-a be the same?
>
>
> Not with cubic splines in general, as it requires FOUR control points to
> determine the location of any point on the curve.  a-b-a does not give
> sufficient information to determine a cubic spline curve.  As to what is
> happening to your curve, check the documentation:
>
> *Cubic splines can be calculated in the range between the second and last
> but one argument. In the remaining parts linear splines are used.
>
> This means that when you shift the control points, different types of
> splines are being used between the same point locations, and thus
different
> appearances.  Thus you are actually only losing part of your "cubicness"
> ...the "cubicness" between the second and third points...when you change
the
> order number on your points (but gaining "cubicness" on the new second and
> new third points).  I hope my explanation is clear enough to help......
>
> Quadhall
>
>


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Cubic splines in megapatch, order of points matters?
Date: 27 Sep 2000 13:27:13
Message: <39D22CAA.7285F0F5@my-dejanews.com>
Yes, I didn't read the phrase :
"Cubic splines can be calculated in the range between the second and last but
one argument. In the remaining parts linear splines are used."

So this spline is only half a loaf solution.  I will restudy Chris's work and a
file that Jerry gave me.  Thanks all anyway.

Spock wrote:

> Might be an idea to compare a,b,a,c with c,a,b,a.
>
> I would suspect the a,b,a curve should be identical in both cases.
>
> It might have been a typo, but I am pointing a suspicious finger at the
> duplicate "a" in your sequence and suggesting you introduce a new point "c"
> to test this theory.  Sorry I don't have a better way of expressing this.
>
> I hope it works.
>
> "Quadhall" <tre### [at] ww-interlinknet> wrote in message
> news:39d20e96@news.povray.org...
> >
> > Greg M. Johnson wrote in message <39D1E46B.CDB2D1A6@my-dejanews.com>...
> > ......
> > >a,a,b,a  gives very different results from a,b,a,a
> > >
> > >Shouldn't any a-b-a be the same?
> >
> >
> > Not with cubic splines in general, as it requires FOUR control points to
> > determine the location of any point on the curve.  a-b-a does not give
> > sufficient information to determine a cubic spline curve.  As to what is
> > happening to your curve, check the documentation:
> >
> > *Cubic splines can be calculated in the range between the second and last
> > but one argument. In the remaining parts linear splines are used.
> >
> > This means that when you shift the control points, different types of
> > splines are being used between the same point locations, and thus
> different
> > appearances.  Thus you are actually only losing part of your "cubicness"
> > ...the "cubicness" between the second and third points...when you change
> the
> > order number on your points (but gaining "cubicness" on the new second and
> > new third points).  I hope my explanation is clear enough to help......
> >
> > Quadhall
> >
> >


Post a reply to this message

From: John VanSickle
Subject: Re: Cubic splines in megapatch, order of points matters?
Date: 27 Sep 2000 22:42:37
Message: <39D2B112.EBA9626A@erols.com>
Greg M. Johnson wrote:
> 
> But do you get my point?
> 
> a,a,b,a  gives very different results from a,b,a,a

The points you specify do not form this pattern.

-- 
ICQ: 46085459


Post a reply to this message

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