|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have found strange behaviour when spline was readed via function. It returns
unexpected values (one result for whole spline, this result vary from render
torender). I have checked this with standard 3.5a as well as with patched
version with spline cache turned off. Both failed. I don't know function code
yet enough so have no idea what could be wrong. It is not that it appear only
during parsing time. The same appear when function of spline is used in
isosurface.
<SDL>
#version 3.5;
#declare Spline=spline{linear_spline -1 0 0 1 1 0};
#declare f_Spline=function{spline{Spline}};
// test for values readed directly from spline
#declare C=-1;
#while(C<=1)
#debug concat("Spline(",str(C,0,1),")=",str(Spline(C).x,0,-1),"\n")
#declare C=C+.5;
#end
// test for values readed from spline via function
#declare C=-1;
#while(C<=1)
#debug concat("f_Spline(",str(C,0,1),").x=",str(f_Spline(C).x,0,-1),"\n")
#declare C=C+.5;
#end
</SDL>
sample output:
Spline(-1.0)=0.000000
Spline(-0.5)=0.500000
Spline(0.0)=1.000000
Spline(0.5)=0.500000
Spline(1.0)=0.000000
f_Spline(-1.0).x=0.412644
f_Spline(-0.5).x=0.412644
f_Spline(0.0).x=0.412644
f_Spline(0.5).x=0.412644
f_Spline(1.0).x=0.412644
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 12 Aug 2002 10:51:40 +0200, ABX <abx### [at] babilonorg> wrote:
> The same appear when function of spline is used in
> isosurface.
Here is sample script for isosurface case. So, any confirmation of this bug ?
<SDL>
#version 3.5;
#include "functions.inc"
#declare Spline=spline{linear_spline -1 0 0 1 1 0};
#declare f_Spline=function{spline{Spline}};
#declare f_Imitation=function(Y){max(1-abs(Y),0)};
union{
// how it looks - it differs between renders
isosurface{
function{f_r(x,0,z)-f_Spline(y).x}
contained_by{sphere{0 1}}
translate x
}
// how it should look - it should be "glued cones"
isosurface{
function{f_r(x,0,z)-f_Imitation(y)}
contained_by{sphere{0 1}}
translate -x
}
pigment{rgb 1}
translate z*3
}
light_source{1e3*<-9,-5,-9> 1}
background{1}
</SDL>
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I can confirm both described behaviours (isosurface and normal function).
Marc-Hendrik
WinXPPro, Athlon 1800+, 256 MB RAM, Winpov 3.5
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 12 Aug 2002 11:24:23 +0200, "Marc-Hendrik Bremer"
<Mar### [at] t-onlinede> wrote:
> I can confirm both described behaviours (isosurface and normal function).
Thanks
> WinXPPro, Athlon 1800+, 256 MB RAM, Winpov 3.5
Oh, I forgot specyfication
NT4 Sp 6, PII 233, 128 MB, WinPOV 3.5a
NT4 Sp 6, PII 233, 128 MB, UnixPOV 3.5 custom compile under cygwin
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <knselu81q1h2qm5s0qgcbnt1h24f2426ou@4ax.com> , ABX
<abx### [at] babilonorg> wrote:
> I don't know function code
> yet enough so have no idea what could be wrong.
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.
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 12 Aug 2002 12:34:56 +0200, "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.
You mean probably "Add a <0,0,0> to the points during spline creation and it
goes away" since I have no idea how to add 3d vector to the spline defining
function :-)
Yes. It helped.
So does it mean is this a bug or limitation of the spline parser?
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 12 Aug 2002 12:53:10 +0200, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> To change it, change the line in spline
Welcome to the patch writers community ;-)
I will add your note to http://abx.art.pl/pov/patches/
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <7u4fluksk2433n9b66tqhm2ckia797jqle@4ax.com> , ABX
<abx### [at] babilonorg> wrote:
> Welcome to the patch writers community ;-)
Not really. It will make its way into the official source code (also not
available to the public) within minutes in my case ;-)
> I will add your note to http://abx.art.pl/pov/patches/
OK.
Thorsten
PS: I am also looking into the other problem with functions you found
recently. I just have to decide what will be the most efficient way to fix
it....
____________________________________________________
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
|
|
| |
| |
|
|
|
|
| |
|
|