Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Maintaining prim location on shrink

Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
08-02-2004 20:21
When you set a prim's size via llSetPrimitiveParams it grows/shrinks on both sides (just like Stretch Both Sides). Now here is my question: If you have a prim in a link set that will shrink/grow on one axis, how can you reposition after each resize so that one of the sides on that axis is always in the same spot?

Think of a roll of coins standing up on a table. As you take off each coin, the stack should still be sitting on the table.

And the tricky bit is that this prim is in a link set so all llSetPos() and llGetLocalPos() are root relative. Once again I think I have to do something with rotations like llAxes2Rot, but I am at a loss.
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
08-03-2004 00:01
You need to move the object by half the amount of the shrink. So, for your coin example, you'd increase the height position of the stack by half the thickness of a coin each time one is removed.
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-03-2004 00:44
cheat; give the prim an advanced cut of 0 -> .5 then use llSetScale to change the z. put the side that is at .5 against the table. That is the easiest way of doing it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
08-03-2004 03:54
Ohhh... Strife - if that works - you are awesome. Checking....
Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
08-03-2004 04:17
Strife - I could kiss ya. Using a Box primitve I did a B0.12 / E0.62 Cut. Then llSetPrimitiveParams([PRIM_SIZE, <1.0, 0.5, 0.5>]); when varying the X value changes the size of the box on the positive side of the local X axis without moving it. Sooo nice and simple. Thanks!
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
08-03-2004 10:38
Half cuts are also good for doors that pivot around the hinge. Make the hinge the center of the door by cutting half of it awa, and the rotation becomes trivial.
_____________________
~ Tiger Crossing
~ (Nonsanity)
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-03-2004 22:42
oh if you are using basic cut then you can use 0.005 increments.
so 0.125 -> 0.625 would be better. and np.

(i've used them for doors a number of times my self and a few other projects)
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey