|
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
|
02-18-2008 07:30
Is it possible to control this script with a menu: http://lslwiki.net/lslwiki/wakka.php?wakka=llSetScalePerhaps more importantly, is it possible to prevent rescaling altogether if any size parameter of any primitive is less than 0.01 or greater than 10?
|
|
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
|
02-18-2008 08:14
Yes. One could create a script that makes user requests by menu, and then performs the actions.
_____________________
So many monkeys, so little Shakespeare.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-18-2008 11:56
if you use set link prim params along with stored default values of each prims size, any that are outside the range, will fail silently, while the rest would work until they hit their limits....
essentially you'd store a vector for each one... then multiply that vector by a scale increment, something like vector - vector * .1 //-- 10% decrease in size or vector + vector * .1 //-- 10% increase in size
if you are looking to also keep proportions (and someone corect me here if I'm wrong) you also need to store relative link distance from the root and change that by vector your percentage change in size.
example 2 linked default cube side by side double the size of both multply the distance for the link by 2 as well
furmula for link distance of a child is vectore childOffset = llGetPos() - llGetRootPosition(); then to apply that (in the child prim) use llSetPos( llGetRootPosition() + childOffset * percentageChange );
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
|
02-18-2008 12:55
From: Void Singer if you use set link prim params along with stored default values of each prims size, any that are outside the range, will fail silently, while the rest would work until they hit their limits... I'm not sure I understand your suggestion, Void. As it stands, the combination of scripts cited above (one for all prims in the object, one for the root prim) works pretty well. The rescaled prims are even repositioned in relation to the new object scale. The trouble is exactly that a prim with a vector size of 1cm will fail while the rest of the object is scaled down (or, conversely, one with a vector size of 10m will fail if the object is scaled up). The linked set is ruined and there is no way to undo this short of scaling the object up or down again before individually editing the 'failed' prim back to its correct proportions. Having a stored set of default values for every child prim makes sense: I guess the failure could be corrected with a reset. However, unless there is an easy way to do this, I suspect it would be a chore to store default parameters for, say, sixty or more prims in a linked object. I was hoping there might be a method of stopping the script from scaling the object further if any vector parameter of any prim in the linked set is already at the minimum or maximum value.
|