Jump to content

Mirroring - yet another rotation question


Darkie Minotaur
 Share

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

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

Recommended Posts

I know I will chew off my lips when I see the solution, but I'm stuck here.

I want to mirror a prim at an axis - let's say the global x-achis. I got the positioning right - piece of cake. But I just don't get the rotation math right.

How do I get the rotation mirrored properly (let's keep it simple, and take the global x-axis?

Link to comment
Share on other sites

The matter isn't simple but it doesn't take much code to do:

vector mirrorNormal = llRot2Fwd( llGetRot() ); // mirror normal is the mirror's forward(red) directionvector objNormal = llRot2Fwd( objRot ); // object normal is the Prim's forward(red) directionrotation mirrorRot = llRotBetween( objNormal, mirrorNormal );  // rotation from objects YZ plane to mirror planerotation newRotation = objRot*mirrorRot*mirrorRot;

I will not elaborate why it is like that, but try it

llRot2Fwd() is using the X-axis but the code works for any position, not just the global X-axis

:smileysurprised::):smileyvery-happy:

Edit: typo in code

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4078 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...