Skip to main content
GameDev.net gamedev.net
🔒 Locked

math problem for a script

Started by ostamo1 Nov 11, 2004 at 12:51 PM 1 replies 700+ views
Original Post
ostamo1
ostamo1
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___________-
Motorherp
Motorherp
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
[size="1"] [size="4"]:: SHMUP-DEV ::
pmouse
pmouse
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.