Jump to content

llRotLookAt This


Midi Nova
 Share

You are about to reply to a thread that has been inactive for 3492 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

 

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

You are about to reply to a thread that has been inactive for 3492 days.

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
 Share

×
×
  • Create New...