Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

WANTED: serious guide for prim heirarchies

BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
05-26-2007 12:50
I need a serious guide for linking prims.
I understand how to do it (ctrl-L etc), but there's a few things that I'm having trouble getting to grips with, and which would... *should* already exist in this forum (but I couldn't find):

-blue and yellow highlighting of linked objects - whats it mean? - which is child and which is parent?

-which sequence should they be selected in prior to ctrl-L, to ensure the desired child/parent linkages?

-linking objects makes the transform gizmo move to the centroid of both objects, is there a way to make it stay in the parent object? (so I can make nested hierarchies and have them move around the correct pivots - like a human skeleton).

-can linked prim hierarchies be transformed as a group according to the linkages without extensive use of LSL?

-is there a good reference tutorial (better than the various wikis which are great, but lack heaps of usable examples):
http://wiki.secondlife.com/wiki/Rotation
http://rpgstats.com/wiki/index.php?title=Rotation
or is there a prebuilt codebase for animating heirarchies like skeletons etc with some pre-prepared code wrappers to take all the mind numbing euler/quaternion stuff out of it?
Jim Guyot
Tinkerer
Join date: 21 Apr 2007
Posts: 38
05-26-2007 13:23
I'm still fairly new to SL, but I can answer some of whatyou are asking about.

1) Blue is for all child prims. Yellow is for the Root prim for all the linked prims.

2) If you have a specific sequence for your prims in a linked set, they should be done in reverse order. Starting with the furthest child prim, and ending at the root prim. Also, if you have specific parts that need to be linked prior to linking to the main prim, link those in reverse order as well, and then link them into the root prim after they are finished. Remember that the prim's number is based on when it was selected, later selections getting progressively lower numbers.

The rest of the stuff I don't know about. However, Euler/quaternion mathematics, and conversions between the two, are not actually that difficult. The math is pretty straight forward, but then agaiin, I had to take a lot of math in college, so I have an advantage. I will see if I can script something that will ease making rotational changes, but no guarantees on when that will be finished, as I have quite a few projects going on at the moment.
BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
05-26-2007 16:34
re: blue/yellow: *wink* I know, I went and found out after I asked, I just wanted for it to be searchable in this forum :] I was amazed it wasn't here when i looked before. So with that in mind...

I'm now curious; does the full tree structure get passed into the linkage?
eg:
I have 7 objects A,B, C,D, E,F, G
If I sequence the linking correctly (as below), and link them as per this diagram:
.....................A
...............B...........C
............D...E.......F...G
ie: link:
D + E to B
F + G to C
B + C to A

is LSL scripting then able to recognise the correct tree-like heirarchy? or does it just recognise a linear heirarchy with only one path from root to furthest child?...like:
.....A
.....B
.....C
.....D
.....E
.....F
.....G
I would assume it recognises the tree (the first diagram), as you mentioned index numbers above... but it would be nice to see it spelled out very clearly (for me to be certain as well as any future searchers).

Also, I have no real problem with rotations either, but my lack of serious mathematical skills tend to make this kind of programming burn my brain a little... i was more curious aboout if anybody had already made some good wrappers, or if there is a collection of good LSL examples out there somewhere?

Right now I'm trying to figure out 1) how to, and 2) whats the best way, and 3) *if* i even can, do some heirarchical rotatons for attachment limbs (and some simple animations for them) I'm wanting to make.... but working it out from nothing is MUCH harder than if I had some decent examples to learn/paste from.
Such things usually also make it really easy to see if what i am trying to do is even worth trying in LSL.
Although I have some promising looking code already underway, i have a feeling that this kind of thing may prove to be a waste of time.... mainly because of this
https://wiki.secondlife.com/wiki/Prim_and_Object_Hierarchy
being a feature request, and not a function description, as I was hoping when i first saw it.
I'm thinking that if this kind of thing doesn't already exist, maybe it won't work properly the way I am trying it.
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
05-26-2007 16:58
Unfortunately there is no tree heirarchy in links. There is only the root, and everything relative to it.

People have done the whole thing by hand, following all the quaternions and vectors around, but the effects are usually of the jerky and not terribly satisfying variety (depending on what you're trying to build), and can get very messed up if things are laggy. I also don't know of any open source code to do the above.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
05-26-2007 17:26
I had a feeling that was the case.
Do you know where I might find any of this code you mentioned? I'd like to have a look.

I'm basically just experimenting with the *concept* of animating simple hierarchies this way.... legs, arms, wings and more simple appendages (less pivots).
...right now I can't get my mind around how to rotate a vector... i'm not sure why. It seems simple enough, i just cant find a starting point.
Do you know of any examples?
Damanios Thetan
looking in
Join date: 6 Mar 2004
Posts: 992
05-27-2007 04:09
This is more of a scripting than a building problem. You'd probably have more luck posting in the scripting tips forum.
_____________________
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
05-27-2007 10:01
From: BETLOG Hax
Do you know of any examples?
I've got some code to make fractal trees here. It's doing the math for that kind of operation.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG