<?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: Vector3d.ProjectTo not working as expected in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764993#M22564</link>
    <description>&lt;P&gt;I tried something similar. It almost works but it's direction vector is not correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I execute the code you provided, the mtext's direction is changed.&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2019 16:26:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-05-01T16:26:58Z</dc:date>
    <item>
      <title>Vector3d.ProjectTo not working as expected</title>
      <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764334#M22560</link>
      <description>&lt;P&gt;I want to project an mtext direction vector onto the z plane. The thing is I don't want an orthogonal projection, I need to project it in the same direction of the mtext's direction vector.&amp;nbsp;I don't know how to explain it right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I tried to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Vector3d proy = mtext.Direction.ProjectTo(Vector3d.ZAxis, mtext.Direction);&lt;/PRE&gt;
&lt;P&gt;This returns (0,0,0), which obviously isn't the result I'm expecting.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 12:03:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764334#M22560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-01T12:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Vector3d.ProjectTo not working as expected</title>
      <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764701#M22561</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whatever the projection plane, if you project a vector using this vector direction, you'll always get a null vector (this is what the code you show does).&lt;/P&gt;
&lt;P&gt;You should explain what you're trying to achieve and or provide some drawing&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 14:22:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764701#M22561</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-05-01T14:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Vector3d.ProjectTo not working as expected</title>
      <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764813#M22562</link>
      <description>&lt;P&gt;My aim is to transform ANY mtext so it's looking upwards (it's normal vector equals (0, 0, 1)).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't want the mtext's rotation, etc.. to be altered, so I'm doing this using the TransformBy() method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to achieve this in two steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 - Rotate the mtext's normal's perpendicular vector&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Vector3d mtextRotatedNormal = mtext.Normal.TransformBy(Matrix3d.Rotation(Math.PI / 2, mtext.Direction, mtext.Location));&lt;/PRE&gt;
&lt;P&gt;Until the direction vector's Z value equals 0 (I need to calculate the correct angle for this transformation).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2- Rotate the mtext's direction vector until the mtextRotatedNormal vector's Z value equals 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With these two steps the mtext's normal should equal (0, 0, 1) but I cannot obtain the right angles for the rotations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was trying to obtain that vector for the calculation of the first angle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 15:11:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764813#M22562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-01T15:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Vector3d.ProjectTo not working as expected</title>
      <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764973#M22563</link>
      <description>&lt;P&gt;This should work:&lt;/P&gt;
&lt;PRE&gt;var location = mtext.Location;
var plane = new Plane(Point3d.Origin, mtext.Normal);
mtext.TransformBy(Matrix3d.WorldToPlane(plane));
mtext.Location = location;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 16:17:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764973#M22563</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-05-01T16:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Vector3d.ProjectTo not working as expected</title>
      <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764993#M22564</link>
      <description>&lt;P&gt;I tried something similar. It almost works but it's direction vector is not correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I execute the code you provided, the mtext's direction is changed.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 16:26:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8764993#M22564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-01T16:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Vector3d.ProjectTo not working as expected</title>
      <link>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8765090#M22565</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;var pt = mtext.Location;
double rot = Vector3d.XAxis.GetAngleTo(mtext.Direction, Vector3d.ZAxis);
var plane = new Plane(Point3d.Origin, mtext.Normal);
mtext.TransformBy(Matrix3d.WorldToPlane(plane));
mtext.Location = pt;
mtext.Rotation = rot;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 17:09:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vector3d-projectto-not-working-as-expected/m-p/8765090#M22565</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-05-01T17:09:53Z</dc:date>
    </item>
  </channel>
</rss>

