Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

stretching using a script

Coll Muggins
Registered User
Join date: 30 Sep 2008
Posts: 2
01-23-2009 17:12
is it possible to stretch a prim on one side using a script and if so how could I possibly go about doing that?
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
01-23-2009 17:58
From: Coll Muggins
is it possible to stretch a prim on one side using a script and if so how could I possibly go about doing that?


i'll try to understand what you mean. it sounds like you tried llSetScale to stretch the prim. if you notice the center stays in the same place. in the edit window you can check/uncheck stretch both sides. i assume you want to stretch the prim as if you have it unchecked so that one side stays put and the opposite side gets moved and the other sides are stretched.

probably not a very good explanation of that lol, i'm not good at that, i tend to overcomplicate things if i try

anyways, if you understand that, and it is what you mean, you would stretch the object, and then move it by half of what you stretched so that one side stays put

the below script will stretch it along the z axis and then move it so that the bottom stays where it's at

CODE

vector stretch = <0.0,0.0,0.125>;

default
{
touch_start(integer num)
{
llSetScale(llGetScale()+stretch);
llSetPos(llGetPos()+(stretch/2)*llGetRot());

}
}


llSetScale(llGetScale()+stretch);
llSetPos(llGetPos()+(stretch/2)*llGetRot());

those 2 functions can also be replaced with:
llSetPrimitiveParams([PRIM_SIZE,llGetScale()+stretch,PRIM_POSITION,llGetPos()+(stretch/2)*llGetRot()])
arton Rotaru
Registered User
Join date: 27 Aug 2007
Posts: 43
01-23-2009 18:04
Works with a path cutted prim (like a door B:0.125, E:0.625) and llSetScale(<x,y,z>;) or llSetPrimitiveParams([PRIM_SIZE, <x,y,z>]).

Downside is visual primlength 5 meters max.

Or you can try path cut with llSetPrimitiveParams. But i think this won't look like streching.
Coll Muggins
Registered User
Join date: 30 Sep 2008
Posts: 2
01-23-2009 19:41
thank you for the help ill see what I can do