<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: expression controllers in 3ds Max Animation and Rigging Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7936718#M5862</link>
    <description>&lt;P&gt;Here's a solution to the problem of placing a dummy at the intersection of the two lines that are revolving in a cylinder.&amp;nbsp; I used a Maxscript for the dummy and some vector algebra coupled with a numerical solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed all the constraints you had in the model and set up the following.&amp;nbsp; In the image below the cylinder on the left is CylinderA, it has a line linked to it LineA, and at the end of LineA is Point A linked to Line A.&amp;nbsp; There's a similar construction for CylinderB on the right.&lt;/P&gt;&lt;P&gt;To find the position in world coordinates of&amp;nbsp; PointA (pA in the script) I added the position LineA to pA and multiplied by the transformation matrix of Cylinder A.&amp;nbsp; Point B is found similarly but pB is subtracted from LineB because their local coordinates are in opposite directions.&lt;/P&gt;&lt;P&gt;To find the intersection point of the two lines I projected endA onto line B yielding &lt;STRONG&gt;pm&lt;/STRONG&gt;.&amp;nbsp; &lt;STRONG&gt;pm&lt;/STRONG&gt; is then projected to line A yielding &lt;STRONG&gt;pn&lt;/STRONG&gt;. The process is repeated until the difference in the length of the two vectors is less than an acceptable error (0.001 in this example).&amp;nbsp; The location of the intersection is&amp;nbsp; the last computed position of &lt;STRONG&gt;pm&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dummy001&lt;/STRONG&gt; will track the intersection of the two line if either cylinder A or B is rotated about its &lt;U&gt;local Y axis&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;The mechanism will still work if either cylinder A or B is rotated about its &lt;U&gt;world Z axis&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;No check is made if the two lines are not coplanar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;endA = (LineA + pA) * cylAT
endB = (LineB - pB) * cylBT
midA = LineA * cylAT
midB = LineB * cylBT
uB = normalize (midB-endB)
uA = normalize (midA-endA)
pm = endB + uB * (dot uB (endA - endB))
pn = endA + uA * (dot uA (pm - endA))
lenM = length(pn-pm)
pm = endB + uB * (dot uB (pn - endB))
lenN = length( pn-pm)
while  abs(lenM - lenN) &amp;gt; 0.001 do
(
pn = endA + uA * (dot uA (pm - endA))
lenM = length(pn-pm)
pm = endB + uB * (dot uB (pn - endB))
lenN = length( pn-pm)
)
p = pm&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dd1.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/489295i706D1642C98B91C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="dd1.JPG" alt="dd1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Apr 2018 00:59:06 GMT</pubDate>
    <dc:creator>leeminardi</dc:creator>
    <dc:date>2018-04-17T00:59:06Z</dc:date>
    <item>
      <title>expression controllers</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7930290#M5860</link>
      <description>&lt;P&gt;hi, everybody, I constrained green dummy to the red line I used path contrast. how I can drive it on the path exact at the intersection point of the green line whit expression controllers.&lt;BR /&gt;thank you so much &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled picture.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/488330i5E0355A177519D9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled picture.png" alt="Untitled picture.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 09:09:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7930290#M5860</guid>
      <dc:creator>mad.kaveh</dc:creator>
      <dc:date>2018-04-13T09:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: expression controllers</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7931587#M5861</link>
      <description>&lt;P&gt;First list the assumptions you are making about the positioning of cylinder001 with respect to cylinder003.&amp;nbsp; &amp;nbsp;The axes of the two must be on the same plane.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you want&amp;nbsp;to be able to move one of the cylinders with respect to the other or are their position fixed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The path of the green dummy for the configuration shown is an ellipse.&amp;nbsp; Rather than constraining the dummy to a line from one of the cylinders I would give it an expression controller and relate its position to the angle of rotation of one of the cylinders.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 17:42:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7931587#M5861</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2018-04-13T17:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: expression controllers</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7936718#M5862</link>
      <description>&lt;P&gt;Here's a solution to the problem of placing a dummy at the intersection of the two lines that are revolving in a cylinder.&amp;nbsp; I used a Maxscript for the dummy and some vector algebra coupled with a numerical solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed all the constraints you had in the model and set up the following.&amp;nbsp; In the image below the cylinder on the left is CylinderA, it has a line linked to it LineA, and at the end of LineA is Point A linked to Line A.&amp;nbsp; There's a similar construction for CylinderB on the right.&lt;/P&gt;&lt;P&gt;To find the position in world coordinates of&amp;nbsp; PointA (pA in the script) I added the position LineA to pA and multiplied by the transformation matrix of Cylinder A.&amp;nbsp; Point B is found similarly but pB is subtracted from LineB because their local coordinates are in opposite directions.&lt;/P&gt;&lt;P&gt;To find the intersection point of the two lines I projected endA onto line B yielding &lt;STRONG&gt;pm&lt;/STRONG&gt;.&amp;nbsp; &lt;STRONG&gt;pm&lt;/STRONG&gt; is then projected to line A yielding &lt;STRONG&gt;pn&lt;/STRONG&gt;. The process is repeated until the difference in the length of the two vectors is less than an acceptable error (0.001 in this example).&amp;nbsp; The location of the intersection is&amp;nbsp; the last computed position of &lt;STRONG&gt;pm&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dummy001&lt;/STRONG&gt; will track the intersection of the two line if either cylinder A or B is rotated about its &lt;U&gt;local Y axis&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;The mechanism will still work if either cylinder A or B is rotated about its &lt;U&gt;world Z axis&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;No check is made if the two lines are not coplanar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;endA = (LineA + pA) * cylAT
endB = (LineB - pB) * cylBT
midA = LineA * cylAT
midB = LineB * cylBT
uB = normalize (midB-endB)
uA = normalize (midA-endA)
pm = endB + uB * (dot uB (endA - endB))
pn = endA + uA * (dot uA (pm - endA))
lenM = length(pn-pm)
pm = endB + uB * (dot uB (pn - endB))
lenN = length( pn-pm)
while  abs(lenM - lenN) &amp;gt; 0.001 do
(
pn = endA + uA * (dot uA (pm - endA))
lenM = length(pn-pm)
pm = endB + uB * (dot uB (pn - endB))
lenN = length( pn-pm)
)
p = pm&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dd1.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/489295i706D1642C98B91C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="dd1.JPG" alt="dd1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 00:59:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7936718#M5862</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2018-04-17T00:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: expression controllers</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7938047#M5863</link>
      <description>&lt;P&gt;I appreciate so much leeminardi .&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 13:13:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/expression-controllers/m-p/7938047#M5863</guid>
      <dc:creator>mad.kaveh</dc:creator>
      <dc:date>2018-04-17T13:13:17Z</dc:date>
    </item>
  </channel>
</rss>

