POV-Ray : Newsgroups : povray.general : bug with spline in function : Re: bug with spline in function Server Time: 26 Sep 2017 21:39:41 GMT
  Re: bug with spline in function  
From: Thorsten Froehlich
Date: 12 Aug 2002 10:53:13
In article <3d578f54@news.povray.org> , "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> Easy:  The code handling vector functions assumes three or more return
> values and acts a bit strange when dealing with only two.  The way you
> declare the spline you create a two diemensional spline, which is what
> causes the odd effects.  Add a 3D vector to the spline and it goes away.

To be more precise, the spline function evaluator for functions - that is,
the internal spline function f_spline in fnintern.cpp - assumes the location
of the parameter is always the fourth stack entry.  This effectively
supports only 3D vectors (support for other vector sizes was added only
recently).  To change it, change the line in spline from

Get_Spline_Val((SPLINE *)(f->private_data), PARAM_N_X(3), Result, &Terms);

to

Terms = ((SPLINE *)(f->private_data))->Terms;
Get_Spline_Val((SPLINE *)(f->private_data),PARAM_N_X(Terms),Result,&Terms);

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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