Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to extend/contract object size/dimensions?

Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
11-30-2005 20:50
Hi,

What's the best way to script the modification of an objects dimensions?

For example a vertical post with a light on the top, and I want to have the height of the post slowly getting smaller, then larger, then smaller etc. I'm not sure that making it a vechicle would help. Would really like to be able to say OBJECT.WIDTH=xxx, OBJECT.HEIGHT=xxx

Tks
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
11-30-2005 20:52
llSetPrimitiveParams()

http://secondlife.com/badgeo/wakka.php?wakka=llSetPrimitiveParams

You'll need to build an incremental loop into your script so the prim transitions more smoothly.
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-30-2005 20:57
Yea...loop it with a very small "step". It's gonna be "jumpy" anyway...but if you keep the step small it'll be nice enough.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-30-2005 22:08
could use a for statement
CODE

integer x;
integer max =5;
default
state_entry
{
for (x = 0; x < max; x++) //do stuff 5 times from 0 to 4
{
(vector) size = <1,1,1>;
set prim prams stuff
size += <0.5,0.5,0.5>;
}
}



dont quote me on that tho heh
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
11-30-2005 22:20
Tks - I take it anything LINKED to top of the prim will go up as well no doubt (e.g. the light on the top of the post)
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
11-30-2005 22:27
From: Greg Hauptmann
Tks - I take it anything LINKED to top of the prim will go up as well no doubt (e.g. the light on the top of the post)


Ooh, that's going to pose a problem. In order for the linked primitives to move along with any other you need to adjust their positions when the resizing prim resizes. Due to our inability to affect two primitive's properties at the exact same time, the movement will appear jerky at best, horribly miscalibrated and random at worst.
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-30-2005 22:32
i agree but it doesnt have to be as horrid as it sounds... eventho I R teh SUXOR at math, but it seems like sin and cosin could be used here, get the start positions and end ones along with size and let lsl handle the curve
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
11-30-2005 22:36
From: Osgeld Barmy
i agree but it doesnt have to be as horrid as it sounds... eventho I R teh SUXOR at math, but it seems like sin and cosin could be used here, get the start positions and end ones along with size and let lsl handle the curve


Its not as easy as you make it out to be - try getting two things to move in sync (without linking them) in something as simple as a straight line. One lags behind the other randomly.
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-30-2005 22:37
yep but i was trying to bing some form of hope to something that at best is gonna be awkward hehe
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
11-30-2005 22:50
I was thinking the pole and light on top could be linked - the llSetPrimitiveParams would need to be applied to one of the linked items if this is possible - if it is hopefully the linked objects would move in coordination no?
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
11-30-2005 23:52
Yes, linked objects will move together. However, they will not SCALE together. So, if you want a light pole that grows taller (but not thicker), then one script should do the trick. Simply make a 10m tall pole, and have it mostly buried until it needs to rise.
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
11-30-2005 23:57
tks