|
|
Is it me, or is there something slightly strange happening with
functions of higher dimensional splines?
[I was working on an isosurface driven by spline functions and I wanted
to control four different aspects of the isosurface with spline
functions. So I just thought it would be more elegant to write it as one
4D or 5D spline instead of four 1D splines or two 2D splines.]
Here's a fairly minimal scene showing the behaviour.
The red 3D spline function does what I expect.
The white 5D spline function seems to behave strangely.
If I evaluate the 3D and 5D functions in the same loop, then the 5D one
behaves sensibly.
If I use real splines instead of spline functions,
#declare Five = spline {natural_spline ...
then this test scene behaves sensibly, [but I want to use the functions
as isosurface functions].
// Looking at the behaviour of 5D spline functions
camera { location <3, 3, -5> look_at <0.5, 0, 0> angle 25}
light_source {<100,200,-500> colour rgb 1}
#declare Three = function {
spline {
natural_spline
-1, < 0.4, 0.1, 1.0>,
-0.2, < 0.1, 0.1, 0.4>,
1, < 1.0, 0.1, 0.2>
}
}
#declare Five = function {
spline {
natural_spline
-1, < 0.4, 0.1, 1.0, 0.5, 0>,
-0.2, < 0.1, 0.1, 0.4, 0.2, 0>,
1, < 1.0, 0.1, 0.2, 0.4, 0>
}
}
// The 3D function (red) does what I expect
#declare Y=-1;
#while (Y<1)
sphere {<Three(Y).x,Y,0>,0.03 pigment {rgb x} }
#declare Y=Y+0.01;
#end
// The 5D function (white) behaves strangely
#declare Y=-1;
#while (Y<1)
sphere {<Five(Y).x,Y,0.1>,0.03 pigment {rgb 1} }
#declare Y=Y+0.01;
#end
// Interleave the 3D and 5D function invocations
// and the 5D (blue) one behaves sensibly now
#declare Y=-1;
#while (Y<1)
sphere {<Three(Y).x,Y,0.2>,0.03 pigment {rgb y} }
sphere {<Five(Y).x,Y,0.3>,0.03 pigment {rgb z} }
#declare Y=Y+0.01;
#end
Post a reply to this message
|
|