Notifications
Clear all

[Closed] Mirror Node Across Axis

Now Denis imagine that on the script that Archangel posted instead of pivotTm:(matrix3 1) it was a point helper i agree it was unnecessary for the stripped down version of the function snipped i posted, my bad.

 PEN

flipMatrix=scaleMatrix [1,-1,1] --Flip Y
mirrorMatrix=scaleMatrix [-1,1,1] --Mirror across X
flipMatrix*theNode.transform*mirrorMatrix

This results in not ending up with a left handed matrix just as the bone mirror does.

 PEN

Don’t know if this helps.

This mirrors p2 using the matrix of p1 around the matrix of p3

I didn’t look but it should be the same as the function that was posted.


delete objects

p1=point name:"p1" box:true axisTripod:true size:40 wireColor:green --Original
p2=point name:"p2" box:true axisTripod:true size:40 wireColor:red --Object to mirror
p3=point name:"p2" box:true axisTripod:true size:40 wireColor:blue --Point to mirror around

--Some random transforms
p1.transform=(matrix3 [0.915556,-0.216362,0.339036] [0.246946,0.967776,-0.0492678] [-0.317451,0.128831,0.939483] [-68.75,-7.23684,0])
p3.transform=(matrix3 [0.909609,0.415465,0] [-0.415465,0.909609,0] [0,0,1] [-31.0931,13.3833,0])

--Calc the mirrors
--Mirror needs to happen twice, first returns a left handed matrix and the second reverses that again to a right handed one.

flipTm=scaleMatrix [1,-1,1] --Axis to flip
mirrorTm=scaleMatrix [-1,1,1] --Axis to mirror around

p2.transform=flipTm*(p1.transform*inverse p3.transform)*mirrorTm*p3.transform

Page 3 / 3