Dear community,
I picked up a set of curtains from a friend, and there's a nice script that controls its opening/closing sequences.
It's working fine, but the sequences require a bit of tuning in order to make the sequences smoother, especially after having increased the size of the curtains on the x axis.
Here's the snippet that does it all, I've kept the rest of the script hidden cos it's not really useful. All it really does is resetting the size of the curtain in a while loop.
There are 4 curtains total, each one with that script in. Then they are all linked up together.
Can someone point me in the right direction and offer some advice on sliding curtains in a smooth manner?
Do let me know if you need further details.
vector offset = <1,0,0>; //Prim moves/changes size along this local coordinate
float hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes?
//The one with the higher (local) coordinate?
float min = 0.2; //The minimum size of the prim relative to its maximum size
integer ns = 10; //Number of distinct steps for move/size change
open_me()
{
integer i;
do llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
while ((++i) < ns);
offset = - offset;
}