Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
|
12-02-2004 18:21
I need some pointers on using a script to alter the "cut" properties of prims.
My room is a single cylinder (ie. a single wall) Instead of creating a door, it would be nice just to have the prim cut itself to let me in!
to go from this ----> O to this --->C and hen back to this --->O get me?
any pointers would be apreciated!
~Lefty
|
Pedro Pendragon
Registered User
Join date: 15 Jan 2004
Posts: 77
|
12-02-2004 20:59
You'd need the llSetPrimitiveParams() function to do this. probably something like this: float HOLLOW = 0.95; // 95% hollow vector TWIST = <0, 0, 0>; // no twist vector TOPSIZE = <1, 1, 0>; // top size same as bottom vector TOPSHEAR = <0, 0, 0>; // no shear
setStatus(integer status) { float cut_begin = 0.0; float cut_end = 1.0; if(status == OPEN) // otherwise, use the params above: it's closed { cut_begin = 0.10; cut_end = 0.90; } llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <cut_begin, cut_end, 0>, HOLLOW, TWIST, TOPSIZE, TOPSHEAR]); }
Check out the scripting wiki page on it for more info: http://secondlife.com/badgeo/wakka.php?wakka=llSetPrimitiveParams
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
12-03-2004 01:06
or float cutEnd = 0.9; //set to your preference - 1.0 is closed, 0.5 is half a cylinder float HOLLOW = 0.95; // set this to match the same setting in the editor vector TWIST = <0, 0, 0>; // same as above, match to the editor vector TOPSIZE = <1, 1, 0>; // ditto vector TOPSHEAR = <0, 0, 0>; // and again integer OPEN = FALSE;
default { touch_start(integer total_number) { if(OPEN == FALSE) { // is CLOSED so OPEN llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER,0, <0.0, cutEnd, 0>, HOLLOW, TWIST, TOPSIZE, TOPSHEAR]); OPEN = TRUE; } else { //is OPEN so CLOSE llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER,0, <0.0, 1.0, 0>, HOLLOW, TWIST, TOPSIZE, TOPSHEAR]); OPEN = FALSE; } } }
It'd be nice if we could llGet the primitive params and then only modify a certain param instead of all at once. Maybe we can and I'm just not aware of the ability.
|
Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
|
you guys rock
12-03-2004 17:36
all your help is apreciated! perhaps this really IS a community.
~Lefty
|
Pedro Pendragon
Registered User
Join date: 15 Jan 2004
Posts: 77
|
12-04-2004 13:37
DoteDote, You can get the current parameters with llGetPrimitiveParams(). Details can be found at: http://secondlife.com/badgeo/wakka.php?wakka=llGetPrimitiveParams
|