|
|
When playing around with MechSim (BTW great job, Christoph!), I came
across field functions. But somehow I can't get them to work properly.
They behave totally strange. The code below shows my problem.
The field function which is used is taken from the documentation. If
you set DIRECTION (right at the top) to 1, it will result in an upward
force, DIRECTION = -1 means a downward force.
In the first case (DIRECTION = 1), everything is perfectly normal. The
masses move up a little bit. But when setting DIRECTION = -1, the
masses dissappear. Not totally, of course. Checking the positions
reveals that they are far far away. Much farer than with DIRECTION =
1. How can that be?
Here's the code (render as still, change DIRECTION to -1, render again
and compare the debug stream output):
<code>
#version unofficial MegaPOV 1.0;
#include "mechsim.inc"
#declare DIRECTION = 1;
background { rgb 1 }
camera { location <1,0.5,-0.25>*10 look_at 0 }
light_source { <1,1,-1>*10 rgb 1 }
global_settings { assumed_gamma 1 }
global_settings {
mechsim {
topology { mass { 0,0,0.1 mass 1 } }
field {
Vector_Function(
function { 0 },
function { 0.1*DIRECTION },
function { 0 }
)
}
}
}
sphere { mechsim:mass(0):position,0.1 pigment { rgb<1,0,0> } }
#debug concat("\n*** Position with DIRECTION = ",str(DIRECTION,0,0),":
<",vstr(3,mechsim:mass(0):position,",",0,3),">\n")
</code>
It could be a time_step problem, but then why does it work with
DIRECTION = 1?
BTW, I had to change the declaration of Vector_Function in mechsim.inc
from
<code>
#macro Vector_Function(Fn_X, Fn_Y, Fn_Z)
Vector_Function_Range(
function { Fn_X(x, y, z) ,
function { Fn_Y(x, y, z) ,
function { Fn_Z(x, y, z) ,
MSim_Fn_Range
)
#end
</code>
to
<code>
#macro Vector_Function(Fn_X, Fn_Y, Fn_Z)
Vector_Function_Range(
function { Fn_X(x, y, z) }, //Added } to all 3 lines
function { Fn_Y(x, y, z) },
function { Fn_Z(x, y, z) },
MSim_Fn_Range
)
#end
</code>
Otherwise it wouldn't render at all. Is this a bug,a feature or my fault?
BTW I'm using MegaPOV 1.0 on WindowsME.
Thanks for your help,
Florian
--
//=================[web: http://www.torfbold.com]==================\\
#local a=-5;#while(a<5)sphere{<sin(a*pi)*5a*10pow(a,5)*.01>sin(a*a*a*
.1)+1pigment{rgb 9*z}}#local a=a+.01;#end camera{look_at-y*10location
<8,-3,-8>*10}// [www.povray.org] [www.imp.org] [www.irtc.org]
Post a reply to this message
|
|