|
|
I was doing some POV 'sketching' (basically, drawing some outlines and
points that I know I will need, with the intention of filling in the
rest later). For one section, I decided to use a sphere_sweep, starting
and ending on two previously marked points.
When I placed in those sweeps, and did a quick test render, I was caught
by surprise... the ends of the sweeps did not coincide with the
previously plotted points!
After some head scratching, as a test, I changed from a b_spline to a
cubic_spline in the sweep.... and the endpoints were exactly where I
would have expected them to be.
Now... is this a documentation imprecision, a misunderstanding on my
part as to how the b_spline sweep works, or a bug?
Below is a snippet of the code used. This reproduces the error on my
system (Athlon 850, Win98se, 256Mb RAM, POV3.5)
---------------------------------------------
#include "colors.inc"
// Command Line Switches: FN +W800 +H800 +UA +AM2 +A0.2
// If the Width is <>
camera {
location <0,0,-15.1>
right x
up y
look_at <0,0,0>
}
light_source { <-9,8,-40> rgb<1,1,1>*1.5 shadowless area_light x*7,
y*6, 3,3 }
#declare topy=2*1.618;
#declare rightx=2;
#declare Point = sphere {0,0.1 pigment { color Yellow }}
object {Point translate <rightx, topy,0>}
object {Point translate <-rightx, topy,0>}
object {Point translate <rightx * 0.725, topy * 1.09,0>}
object {Point translate <rightx * 0.45, topy * 1.14,0>}
object {Point translate <rightx * 0.175, topy * 1.1618,0>}
object {Point translate <-rightx * 0.725, topy * 1.09,0>}
object {Point translate <-rightx * 0.45, topy * 1.14,0>}
object {Point translate <-rightx * 0.175, topy * 1.1618,0>}
object {Point translate <-rightx, -topy,0>}
object {Point translate <rightx, -topy,0>}
object {Point translate <rightx * 0.725, topy * -1.09,0>}
object {Point translate <rightx * 0.45, topy * -1.14,0>}
object {Point translate <rightx * 0.175, topy * -1.1618,0>}
object {Point translate <-rightx * 0.725, topy * -1.09,0>}
object {Point translate <-rightx * 0.45, topy * -1.14,0>}
object {Point translate <-rightx * 0.175, topy * -1.1618,0>}
#declare Side=sphere_sweep {b_spline 7,
<rightx* 1.38, topy * 2, 0>, 0.1,
<rightx, topy, 0>, 0.1,
<rightx/1.38, topy * 0.5, 0>, 0.1,
<rightx/1.618, 0, 0>, 0.1,
<rightx/1.38, -topy * 0.5, 0>, 0.1,
<rightx, -topy, 0>, 0.1,
<rightx* 1.38, -topy * 2, 0>, 0.1
pigment { color Brown }
}
Side
object {Side rotate y*180}
------------------------------------------------------------
Post a reply to this message
|
|
|
|
ABX wrote:
> On Thu, 10 Apr 2003 23:50:07 -0700, Brendt Hess <bre### [at] attbicom> wrote:
>
>>When I placed in those sweeps, and did a quick test render, I was caught
>>by surprise... the ends of the sweeps did not coincide with the
>>previously plotted points!
>
> As it is stated there only linera_spline is ineterpolation. b_spline and
> cubic_spline is aproximation. The property of interpolation is that if you have
> contol point given for some t parameter then
>
> Interpolation( t ) = Control_Point( t )
>
> while in aproximation
>
> Interpolation( t ) <> Control_Point( t )
>
> (Or perhaps I misunderstand your problem)
>
No, you understand the problem. I read that, but interpreted the
paragraph differently, at least for the spline endpoints. However,
looking again this morning, I found this piece of documentation:
http://www.povray.org/documentation/view/51/#s03_04_04
"When using a b_spline, the resulting object is somewhat similar to the
cubic sweep, but doesn't actually go through the control points. It lies
somewhere between them."
With this, I now understand. Of course, this is particularly hard to
find in the documentation... mostly because hitting F1 while on the
b_spline keyword takes you to section 6.5.1.10, which does not explaing
this bit about the splines. This is in section 3.4.4 only.
(Sec. 3.4.4 also notes that a Cubic spline passes through the control
points.) I'm still a bit surprised about the degree of imprecision on
the endpoints (about +/-.25 Y units beyond the theoretical endpoints,
with the X value precise). Examining it, I guess that the decision
about where the endpoint actually falls is something like when the X, Y,
and Z values are all >= the designated control point location. Hmmm...
let's see if I can test that... Nope... the difference appears to be
solely constrained by the distabce between the first and second control
points.
For example, using my previous sample, the final point plotted is +/-
.25y. Changing the first control point's Y position to topy+22 places
the end of the sweep off of the screen. Pulling the camera back, the
end looks to be about 9 or ten units +y.
Odd... perhaps this should be placed as an example in the documents
(simplified, of course). At least section 6.5.1.10 should reference
3.4.4 for information about the spline types.
Post a reply to this message
|
|