Sign in to follow this  
ostamo1

math problem for a script

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this