Jump to content

fastblock

Resident
  • Posts

    4
  • Joined

  • Last visited

Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ok, I see, there is no clean solution. Anyway thank you all for your support.
  2. Thanks for all your hints. To illustrate it I've recorded two scenarios: unattached and attached PRIM (avi center). Not recorded but tested with fix avatar pose, makes no difference. As soon as the avatar is rotating the direction of the PRIM gets inaccurate.
  3. Thank you for your prompt reply. I know this example and have already tested it. Unfortunately it doesn't work. What I've done: I've created a cube, pasted in the Wiki example, attached the box to my avatars skull and ran around another avatar. As soon the avatar is moving or rotating on which the PRIME is attached the PRIME does not look at the right direction anymore. (e.g. to the nearest avatar). Did I forget something special? 🤔 Merry-Xmax!
  4. I researched and tested many hours without success. What I've done so far is to rotate a PRIM in the direction to an avatar, so that the PRIM looks at the target avatar. 2 Solutions a) // get the traget position vector targetPos = llList2Vector( llGetObjectDetails( KEY, [OBJECT_POS]), 0); llLookAt(targetPos,1,1); b) vector startPos = llGetPos(); float distance=llVecDist(<targetPos.x,targetPos.y,0>,<startPos.x,startPos.y,0>); rotation rot = llRotBetween(<1,0,0>,llVecNorm(<distance,0,targetPos.z - startPos.z>)) * llRotBetween(<1,0,0>,llVecNorm(<targetPos.x - startPos.x,targetPos.y - startPos.y,0>)); llSetRot(rot); Both methods work great if the PRIM is on the ground and not attached to an avatar. Now the tricky part, I need the same behavior when the PRIM is attached on my avatar (eg. on pelvis or center point, ...). I know the above methods are not suitable for this case. I've tried a lot to adapt method b) for my needs using llGetLocalPos(), llGetLocalRot(), llSetLocalRot() in combination with llGetPos() and llGetRot() but without success. My PRIM looks always in the wrong direction. Meanwhile Im lost in this rotation jungle. Would be great if someone can help.
×
×
  • Create New...