|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
07-06-2007 07:09
Picture this, if you will. You have a box prim rezzed before you. It's original <x,y,z> dimensions are <1,1,4> so that it looks like a rectangle standing on its end. I would like to create a script such that subsequent clicks of the prim cause it to "get taller." I don't want the dimensions to simply increase to <1,1,5>, <1,1,6>, <1,1,7> in succession but I want it's base to remainded at ground level and the opposite end to increasingly reach skyward. I imagine there are a number of ways to approach this, altering the scale being one such method, but I wanted to get a variety of opinions on the best, easiest and most efficient way of doing this. Okay, I concede to that fact that best, easiest and most efficient may yield three different solutions, but you get the idea. Thank you and I'm looking forward to your creative solutions. Bartiloux Desmoulins Bartiloux's Den of Sadistic Madness Plush Lambda
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
07-06-2007 07:42
If the growing dimension never has to get larger than 5m, then it's possible to change only the scale, by carving away enough of the prim so the origin is at the bottom of the remaining material and thus scaling will only affect the top.
Otherwise I think the prim will have to be both scaled and translated to keep the bottom at a set location. To do both operations at once, I'd probably use llSetPrimitiveParams().
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
07-06-2007 07:43
llSetPrimitiveParams() and SetPos() if you want a maximum of 10m
llSetPrimitiveParams() on a specifically cut prim (so its center point is at ground level) for a maximum "height" of 5m
It's up to you which method you wish to use.
|
|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
07-06-2007 09:19
Thank you both for your input. I shall try both methods to see which yields the "smoothest" resuls.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
07-06-2007 09:59
You could easily offset this for the full 10m by doing some calculations (like if the prim is to grow 1m each click, then each click it needs to move up 0.5m since a prim will expand evenly on both sides from the middle)
You could combine them in one call of:
llSetPrimitiveParams([PRIM_POSITION,pos+<0,0,0.5>,PRIM_SIZE,size+<0,0,1>]);
|