Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Prim Dynamic Sizing...

Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
07-15-2005 00:32
So the idea is creating a random value between .1 and 10 for the x vector scale of a prim and then setting the prim to that scale. A loop runs that brings the scale down to .1 or less (no less than .01 so we don't get a fail) and then regenerates a random size and restarts the loop...

...problem...llSetScale seems to only work with multiplying an entire vector set by a float...whereas I only want to change one of the vector constants.

Anyone have experience in this area? Any helpful hints?


(Yes, I know I'm asking new questions every night...sorry 'bout that...)
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
07-15-2005 00:38
You can work with elements in a vector. Say like so:
CODE
vector basescale = <10.0, 1.0, 1.0>;
vector setscale = basescale;
float i;
for (i = 1.0; i > 0.0; i -= 0.1)
{
setscale.x = basescale.x * i;
llSetScale(setscale);
}
_____________________
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
07-15-2005 11:48
Ahhh...that looks simple enough. Thank you for the answer!
Champie Jack
Registered User
Join date: 6 Dec 2003
Posts: 1,156
07-16-2005 17:41
in case you haven't found this page in the LSL WIKI :
Vectors
_____________________