xusword

xusword

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

coding help again July 6, 2004, 12:50 a.m.

thank you very much for your help

btw, NO i am not him
but he work as a same project as me
we are group partners

coding help again July 5, 2004, 11:07 p.m.

also
there is another place I need to update global variable

my functions doesn't keep track of which frames does what
so after all the action sequence are finished, I want the object stay at the same position until it is activated again

Therefore I have to update the global variable, the default position of this object…

for example
some function's translate x, y, z are mapped to this function foo

vector foo(){

if ($activate>0){
// calculate x, y, z
run(“setenv DefPos=`vector(x,y,z)`”);// this line doesn't work because it doesn't reconize x, y, z
return vector(x,y,z);
}
else{
return $DefPos;
}

}

guess I can remember the frame number and if inactivate, use the stored frame number instead of the actual frams number, but it would be so inefficient because it would do unnecesssary calculation

coding help again July 5, 2004, 10:02 p.m.

ok guess I have to state my problem again

i wrote my own interpolation function and store the interplated function as a vector
I only want to interpolate my function once in a curve so I store it inside a global variable

for example

some object's translate x, y, z is map to this foo

$polyReady is initially set to -1

vector foo(){

if ($polyReady < 0){
//calculate p1 to p4, they are sample points for our interpolations
run(“setenv $poly=Interp(p1,p2,p3,p4)”);// PROBLEM: cannot pass p1~p4 inside this code…
run(“setenv $polyReady=1”);
}

if ( reach the end of this curve ){
$polyReady = -1;
// WHEN THIS FUNCTION IS CALLED, IT WOULD RE-CALCULATE p1~p4
}

return polyApply($poly, $FF);

}