Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Rigging question - constrain object to intersection between 2 lines

markus
Advocate
Advocate

Rigging question - constrain object to intersection between 2 lines

markus
Advocate
Advocate

 

Is there a way to rig this so the pink box will always be in the position where the two lines intersect? What kind of controller or IK should I use? 

 

(sorry for double-posting. I also posted this in the main forum)

0 Likes
Reply
Accepted solutions (1)
682 Views
7 Replies
Replies (7)

markus
Advocate
Advocate

Fyi, The to splines are on the same 2D plane, and the vertical one is static, while the other is moving and rotating.

0 Likes

markus
Advocate
Advocate

OK, I got a solution from Daniel on the Stack Group on facebook. 
Check it out here on Stack on Facebook 

He solved it using a script controller, a plane and some points. Kudos to Daniel on Facebook for demonstrating his powerful math and scripting skills!! 

markus_0-1696594487302.png

 

 

markus_1-1696594487305.png

 

 

0 Likes

domo.spaji
Advisor
Advisor

Path constraint box with vert. line as target path,

lookat constraint other line to box as lookat target.

 

You can transform/animate all 3 objects - lines intersection will be where box is - that is effectively same thing as you ask for

0 Likes

markus
Advocate
Advocate

Thanks for the idea @domo.spaji 

 

Edit: I posted a reply to the wrong post!

0 Likes

markus
Advocate
Advocate

Daniel has posted an Idea to make this into a regular controller in 3dsmax, which could be useful for mechanical rigging! 

 

3dsmax Ideas  

0 Likes

leeminardi
Mentor
Mentor
Accepted solution

Here's another approach that uses a position script controller that finds the intersection of two 3D lines.  If the lines do not lie on the same plane the intersetion is defined as the mid-point of the shortest distance between the two lines.

leeminardi_0-1696602372560.png

 

p1 = getKnotPoint line1 1 1
p2 = getKnotPoint line1 1 2
p3 = getKnotPoint line2 1 1
p4 = getKnotPoint line2 1 2
pa = p2
pb = p3
for i = 1 to 10 do
(
dot1 = dot (pa-pb) (normalize(p3 - p4))
dot2 = dot (pb - pa) (normalize(p2 - p1))
pb = pb + dot1 * (normalize(p3 - p4))
pa = pa + dot2 * (normalize(p2 - p1))
)
pIntr = (pa + pb)/2 

 

lee.minardi

markus
Advocate
Advocate

Thanks, @leeminardi ! Thats a very good solution!

0 Likes