• Advertisement
Sign in to follow this  

math problem for a script

This topic is 4853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a x,y,z point named root it is located at -4,18,0 and a l_hip located at 2,15,0 i am trying to find the point that mirrors the l_hip and name it r_hip and i want it to be the same distance away from root i am setting up a character rig and i want to be able to set the root and left leg and mirror it over to the right any help is appreciated -__________________root________________________- -______________________________________________- -______________________________________________- -______r_hip___________________l_hip___________-

Share this post


Link to post
Share on other sites
Advertisement
Use the plane equation of the mirror plane to find the distance of l_hip from the plane. Then project the l_hip coord onto the mirror plane and minus the plane norm scaled by the above distance from this projected point to find the location of r_hip. This is how to do it for arbitrary cases but I'm guessing you only want to mirror across the y-z plane. In that case:

r_hip.x = 2*root.x - l_hip.x
r_hip.y = l_hip.y
r_hip.z = l_hip.z

Share this post


Link to post
Share on other sites
You need a reflection about the Y-axis...And I forgot what the matrix look like...Something along the line of

1 0
0 -1

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement