Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

rotation of child Prim

Vik Bethune
Registered User
Join date: 6 May 2006
Posts: 9
11-27-2006 19:15
Hi all,


I have a 3 prim book i'm working on, the root prim is a cylinder used as the spine.
i have a script in the root which wil rotate the link set in a clockwise direction to simulate opening the book. ( imagine the book standing upright with front cover facing you)

I have a script in the Back cover(child prim) which rotates this child prim in the oposite direction at the same time that the front and root are rotating to "open"

the problem is that the child prim rotation happens on its centre axis( z in this case)

I would like to know if its possible to rotate this child prim of the linked set, at its edge ( ie. the z axis plus half the width of the prim) put another way rotate on the edge( face) of the back cover that meets the root prim.

I know I could do things like "rubber banding", but am trying to avoid that !

The pertinent part of the script is as follows:

Thnkyou
:-)


CODE

rotateBackcover(integer Open)
{

initialRot = llGetLocalRot();
rotation rotate180 = llEuler2Rot(<0, 0, PI>);
//rotation rotateBack180 = llEuler2Rot(<0, 0, -PI>);

if (Open)
{
llSetLocalRot(rotate180 / initialRot); //rotatee 180 anticlockwise


}
else
{

llWhisper(0, "Now closed");

}


ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
11-27-2006 20:12
It sounds like a door problem. Most doors in sl are cut in half so they only look like they rotate from the edge.

You could also check out the Timeless Prototype door in the wiki which calibrates two positions for each child prim wrt to the root and responds to touch_start.
Vik Bethune
Registered User
Join date: 6 May 2006
Posts: 9
11-29-2006 20:46
thanks ed44 Gupte,
yes, i had seen the Timeless door, and am trying a few things using llSetPrimitiveParams!