POV-Ray : Newsgroups : povray.general : Functions of higher dimensional splines Server Time
2 Nov 2024 09:17:35 EDT (-0400)
  Functions of higher dimensional splines (Message 1 to 2 of 2)  
From: Mike Williams
Subject: Functions of higher dimensional splines
Date: 19 Mar 2004 13:03:44
Message: <8S6nIDAzQsWAFwNO@econym.demon.co.uk>
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

From: ABX
Subject: Re: Functions of higher dimensional splines
Date: 19 Mar 2004 13:45:05
Message: <2ufm50l66t5fkuc321346eo1fv2069pfvu@4ax.com>
On Fri, 19 Mar 2004 09:58:11 +0000, Mike Williams <nos### [at] econymdemoncouk>
wrote:
> Is it me, or is there something slightly strange happening with
> functions of higher dimensional splines? 

http://news.povray.org/povray.general/thread/%3Cknselu81q1h2qm5s0qgcbnt1h24f2426ou%404ax.com%3E

ABX


Post a reply to this message

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