POV-Ray : Newsgroups : povray.newusers : Re: Spline issues Server Time
26 Nov 2024 10:44:36 EST (-0500)
  Re: Spline issues (Message 1 to 2 of 2)  
From: Mike Thorn
Subject: Re: Spline issues
Date: 17 Jul 2004 11:25:00
Message: <web.40f9445e3d8e8b2649700cac0@news.povray.org>
> I see that your camera look_at spline is going to need at least 3 points
> when using quadratic_spline, 4 if were cubic_spline instead, because each
> preceeding point is a control for the next. The following two points get
> plotted (inbetween first and last if cubic used) on the spline path
> according to that previous point.

I *think* I get the idea...I've always been a little confused over these
points. Basically what you're saying is that I'm missing control points in
my splines, so they're not going the full mile?

> For those skeleton parts you used only a single point at value 9, so that
> would only be plotted at clock=9 (and I believe <0,0,0> at other clock
> values in this case). You'll need to add more points in.

Ah, I thought that it would interpolate across the other 8 clock values. So
it only starts interpolating to the destination vertex once it reaches that
clock point? That would explain a lot. Well, at least adding more points
will be fairly simple.

> Hope that clears things up.

If I understand you correctly in everything, you've solved a billion
problems for me (well, maybe more like 72). Thanks soo much you guys!! :)))

-Happy Guy


Post a reply to this message

From: Hughes, B 
Subject: Re: Spline issues
Date: 17 Jul 2004 13:41:28
Message: <40f964c8@news.povray.org>
Yeah Mike, adding the minimum number of points for the spline type is the
key to this, yes. I was wrong (as I often can be going by memory) that the
splines were automatically factoring in a 0,<0,0,0> point.

It would interpolate from zero to nine if you had at least those two, of the
required three, points listed. That is linear then, having no offsets from a
direct line between them. In essence, you're the one in *control* [:)] of
the points and POV won't count anything not there (aside from inbetweens!).
You have to specify the minimum time values (and points) before it begins to
react according to the spline type.

You might want to give the following SDL a render, to see an example of the
spline types together in one image.

/* spline types comparison */
camera {location -10*z look_at 0}

light_source {-100, 1}

plane {z,0 pigment {checker color rgb 1/3 color rgb 2/3}}

#declare WireQ=
spline {
 quadratic_spline
 -1, <-5,-1,0>,
 0, <-4,0,0>,
 1, <-3,1,0>,
 2, <-2,2,0>,
 3, <-1,1,0>,
 4, <0,0,0>,
 5, <1,-1,0>,
 6, <2,-2,0>,
 7, <3,-1,0>,
 8, <4,0,0>,
 9, <5,1,0>,
 10, <6,2,0>
}

#declare WireL=
spline {
 linear_spline
 -1, <-5,-1,0>,
 0, <-4,0,0>,
 1, <-3,1,0>,
 2, <-2,2,0>,
 3, <-1,1,0>,
 4, <0,0,0>,
 5, <1,-1,0>,
 6, <2,-2,0>,
 7, <3,-1,0>,
 8, <4,0,0>,
 9, <5,1,0>,
 10, <6,2,0>
}

#declare WireC=
spline {
 cubic_spline
 -1, <-5,-1,0>,
 0, <-4,0,0>,
 1, <-3,1,0>,
 2, <-2,2,0>,
 3, <-1,1,0>,
 4, <0,0,0>,
 5, <1,-1,0>,
 6, <2,-2,0>,
 7, <3,-1,0>,
 8, <4,0,0>,
 9, <5,1,0>,
 10, <6,2,0>
}

#declare WireN=
spline {
 natural_spline
 -1, <-5,-1,0>,
 0, <-4,0,0>,
 1, <-3,1,0>,
 2, <-2,2,0>,
 3, <-1,1,0>,
 4, <0,0,0>,
 5, <1,-1,0>,
 6, <2,-2,0>,
 7, <3,-1,0>,
 8, <4,0,0>,
 9, <5,1,0>,
 10, <6,2,0>
}

#local Iterate= -1;

#while (Iterate <= 10)

sphere{
  WireQ(Iterate),0.1
  pigment { color red 1 }
  translate +y
}

sphere{
  WireL(Iterate),0.1
  pigment { color rgb 1 }
  translate 0
}

sphere{
  WireC(Iterate),0.1
  pigment { color green 1 }
  translate -y
}

sphere{
  WireN(Iterate),0.1
  pigment { color blue 1 }
  translate -2*y
}

#local Iterate=Iterate+0.1;

#end


Post a reply to this message

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