Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Do not scale (stretch) on both sides?

Diego Pannotia
Laronzo Fitzgerald
Join date: 14 Nov 2006
Posts: 37
03-24-2007 12:18
Hiya,

Mini conundrum here....

CODE

llSetScale(llGetScale() - <0,1.010,0>);


is not equal to a stretch on just one side of the object, but stretches *both sides*, an option you can uncheck in the building editor toolbar, how can I (or simply, can I?) reproduce this effect in my script?

Many many thanks,

Mark.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
03-24-2007 12:45
You'll have to move the prim by a distance equal to half of the change in size caused by llSetScale.

For example, if you double the scale on the X axis, and want the -X side of the prim to remain fixed:

CODE

vector OldScale = llGetScale();
NewScale = OldScale;
NewScale.x *= 2.;
vector Offset = NewScale - OldScale;
llSetScale( NewScale );
llSetPos( llGetPos() + Offset * llGetLocalRot() );


You can also combine the llSetScale and llSetPos operations into a single llSetPrimitiveParams call.