Midi Nova Posted October 4, 2014 Share Posted October 4, 2014 Another rotation Mystry, The below snipit I am trying to get to work from different attachment points, namely the Skull and both Foramrs. What I can't figure out is the rotation math needed to get from local atacment to region. I have spent a few days on this so i figured it time to ask the question out there to you rotation experts. How do you get a directional rotation such that it causes +y of an attachemnt to point at the choosen region position? vector regionPos; // Some Region Position vector agentPos = llGetRootPosition(); // Agent Position in region rotation agentRot = llGetRootRotation(); // Agent rotation in region vector localPos = llGetLocalPos(); // Attachment Position relative to attachment point rotation localRot = llGetLocalRot(); // Attachment Rotation relative to attachment point llRotLookAt( llRotBetween( < 0.0 , 1.0 , 0.0 > , llVecNorm( ( regionPos - agentPos ) / agentRot ) ), 1.0, 0.4 ); Link to comment Share on other sites More sharing options...
ObviousAltIsObvious Posted October 4, 2014 Share Posted October 4, 2014 sorry, you can't really do this in LSL, the simulator does not have the necessary information about joint rotations. that is all done on the viewer side. for more details see http://wiki.secondlife.com/wiki/LlGetRot#Caveats and http://wiki.secondlife.com/wiki/Rotation#Single_or_Root_Prims_vs_Linked_Prims_vs_Attachments Link to comment Share on other sites More sharing options...
Midi Nova Posted October 4, 2014 Author Share Posted October 4, 2014 What I posed will work from the pelvis, I know the viewer handles the animation. the degree of accuracy im looking for is the same as what it does on the pelvis, but just attached to a different attachment point. Link to comment Share on other sites More sharing options...
ObviousAltIsObvious Posted October 4, 2014 Share Posted October 4, 2014 it will appear to work from the pelvis most of the time, only because many animations do not try to change it. it is not completely reliable. run a spinning, flying, laying animation and you will see the problem. the avatar root point is the only one that wil not be affected by animations at all. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now