Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Another experiment: avatar height and distance from sit target to bottom of feet

Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
08-03-2005 02:41
So I've got an avatar sitting on a smallish prim, and I'm forcing the animation to make the avatar stand. What happens is that llSitTarget tells the avatar where to put its pelvis, and the legs just hang down. The point of doing this is to have the avatar move around (because the prim is moving) whilst appearing to stand, but without the horrible walking animation we always get when one is actually standing on a moving prim.

Problem is, legs of different avatars are of different lengths, so in order to make the feet touch the ground, some correction of the z coordinate of the prim is in order.

Thinking this might be useful for others, here's what I did:

The z coord of llGetAgentSize gets me the height of the av. For some reason the avatar doesn't want to sit on a prim with llSitTarget set to <0,0,0>, so I set it to <0,0,0.5> and adjusted appropriately. Sit on the prim, raise or lower the prim so that my (no shoes) feet just touch a base prim I set up, look at the positions of the prims to determine the distance between the bottom of my feet and the llSitTarget. Alter my avatar's height in appearance, rinse and repeat.

Results are attached. The upshot is that to get the "leg length" from the avatar height, multiply the height by 0.824 and take off 0.721. Should work pretty well judging from the graph.

Given that everyone wears shoes, probably want to add on a few centimeters too.

P.S. this was done with a male avatar. It's possible that sliders other than avatar height have an effect on the leg length, I didn't check. Most likely it's different for female avs, and nothing is going to work for tinies/giant mechas/etc/etc.

P.P.S Oh crap, just found "leg length" in the appearance sliders... well, the above formula still seems to work reasonably well, but not as good as it did before I started messing with those sliders. I think there's little hope of getting anything better though.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-03-2005 04:52
a number of sliders effect avatar height.
Some the height above the pelvis, some below.

Much easier in my mind to use llGetBoundingBox
_____________________
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
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
08-03-2005 08:58
Without knowing the relationship of the point-location of the avatar to its bounding box, all we can ever do is estimate. I had the same problem a year ago when trying to make a chariot vehicle. It we could move the seat point while someone was on it, it would be easy to adjust. But without that, I had to require the riders to click the chariot once first so it could estimate their pelvis height and adjust the seat point. Even so, the estimates remain vague.

Someone with a short upper body but really long legs would throw off the calculations, as one someone with a E.T. neck and stubby legs.

This is one of the gaps in SL.

I'd like to see the sit target be able to pick an attachment point to work with. Then you could have someone standing on a skateboard or hanging from a zipcord and all animations would play correctly.
_____________________
~ Tiger Crossing
~ (Nonsanity)
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
08-03-2005 12:43
From: Strife Onizuka
a number of sliders effect avatar height.
Some the height above the pelvis, some below.

Much easier in my mind to use llGetBoundingBox


Hmm, I had thought that boundingbox would change when the avatar is sitting, but since I'm forcing it to stand, it won't. Is there any difference between AvatarSize and BoundingBox when the av is standing?
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-03-2005 19:22
There is a little difference but the lower vectors z is the distance from the pelvis to the ground.
_____________________
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