<?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: Coordinate system confusion in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629559#M159563</link>
    <description>Technically, the coordinate system Inventor uses is a right-handed &lt;BR /&gt;
coordinate system.  It's customary to show a right-handed coordinate system &lt;BR /&gt;
as you said; X is pointing towards the right, Y is pointing up, and Z is &lt;BR /&gt;
coming out towards you.  However, in reality all that is being specified is &lt;BR /&gt;
the X and Y are perpendicular to one another and Z is coming out of the &lt;BR /&gt;
plane defined by X an Y where the Z direction is defined using the &lt;BR /&gt;
right-hand rule.  That is if you point your fingers in the the direction of &lt;BR /&gt;
the X axis and then rotate them the 90 degress to the Y axis, your thumb is &lt;BR /&gt;
pointing in the direction of the Z axis.  A left-handed coordinate system &lt;BR /&gt;
would have the Z axis in the opposite direction.&lt;BR /&gt;
&lt;BR /&gt;
The coordinate system that you describe your coordinates coming back in are &lt;BR /&gt;
in a right-hand coordinate system so they are valid coordinates.  If you &lt;BR /&gt;
change your view orientation so that X is the right, Y is up, and Z is &lt;BR /&gt;
coming out then the results will probably make more sense to you.  It's just &lt;BR /&gt;
that "up", "left", and "right" are very subjective in a system where you can &lt;BR /&gt;
manipulate the view to any orientaion.  However, rotating the view does not &lt;BR /&gt;
change the coordinate system the part is based on.  It's just repositioning &lt;BR /&gt;
the virtual camera within that coordinate system.  Hopefully this makes some &lt;BR /&gt;
sense.&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Ekins&lt;BR /&gt;
Autodesk Inventor API&lt;BR /&gt;
&lt;BR /&gt;
&lt;MATCHES81&gt; wrote in message news:5159985@discussion.autodesk.com...&lt;BR /&gt;
Hi there!&lt;BR /&gt;
I´m quite confused about the coordinate system Inventor uses.&lt;BR /&gt;
&lt;BR /&gt;
I got a set of Edge objects from an EdgeCollection, which I get from the &lt;BR /&gt;
current selection, which works fine.&lt;BR /&gt;
On each of these Edge objects I call CalculateStrokes(). Now I lock the &lt;BR /&gt;
resulting SAFEARRAY to get a pointer to the array data. This array is then &lt;BR /&gt;
converted into a set of "Keyframe" objects (my own class):&lt;BR /&gt;
&lt;BR /&gt;
//get position from vertexData&lt;BR /&gt;
kf.pos.x = vertexData[(indexData&lt;K&gt;-1)*3];&lt;BR /&gt;
kf.pos.y = vertexData[(indexData&lt;K&gt;-1)*3+1];&lt;BR /&gt;
kf.pos.z = vertexData[(indexData&lt;K&gt;-1)*3+2];&lt;BR /&gt;
&lt;BR /&gt;
everything fine so far, I just wanted to post this part of my code so you &lt;BR /&gt;
can see where I get my position data from.&lt;BR /&gt;
&lt;BR /&gt;
Furthermore I get the normal at that point of the edge through the faces &lt;BR /&gt;
they belong to. I get the data of this normal in a similar fashion: x is &lt;BR /&gt;
retrieved from the first component, y from the second and z from the third &lt;BR /&gt;
component like this:&lt;BR /&gt;
&lt;BR /&gt;
returnVec-&amp;gt;x = p_FaceNormals[closestVertex*3];&lt;BR /&gt;
returnVec-&amp;gt;y = p_FaceNormals[closestVertex*3+1];&lt;BR /&gt;
returnVec-&amp;gt;z = p_FaceNormals[closestVertex*3+2];&lt;BR /&gt;
&lt;BR /&gt;
Okay, now to the confusion:&lt;BR /&gt;
I am used to the following coordinate system (probably from using at school &lt;BR /&gt;
back then):&lt;BR /&gt;
+X is pointing to the right, +Y is pointing upwards and +Z is pointing &lt;BR /&gt;
towards you. According to the API documentation (topic Transient Geometry, &lt;BR /&gt;
at the paragraph on matrices as coordinate systems), Inventor is supposed to &lt;BR /&gt;
use that system, too.&lt;BR /&gt;
However, if I output the unchanged coordinates I retrieved from that Edge, &lt;BR /&gt;
+X seems to be pointing right, +Y towards you (hard to tell) and +Z upwards.&lt;BR /&gt;
Same for the normals I retrieved: I swap Y and Z coordinates in order to get &lt;BR /&gt;
into "my coordinate system"....&lt;BR /&gt;
&lt;BR /&gt;
Okay, that´s my problem: It would be great to _definitely know_ which &lt;BR /&gt;
coordinate system Inventor uses in that data I retrieve from an Edge with &lt;BR /&gt;
CalculateStrokes and from a Face with CalculateFacets. So, is it a &lt;BR /&gt;
left-handed or right-handed system, which directions are the axes pointing &lt;BR /&gt;
to?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for reading and answering.&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/MATCHES81&gt;</description>
    <pubDate>Mon, 01 May 2006 20:37:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-05-01T20:37:37Z</dc:date>
    <item>
      <title>Coordinate system confusion</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629558#M159562</link>
      <description>Hi there!&lt;BR /&gt;
I´m quite confused about the coordinate system Inventor uses.&lt;BR /&gt;
&lt;BR /&gt;
I got a set of Edge objects from an EdgeCollection, which I get from the current selection, which works fine.&lt;BR /&gt;
On each of these Edge objects I call CalculateStrokes(). Now I lock the resulting SAFEARRAY to get a pointer to the array data. This array is then converted into a set of "Keyframe" objects (my own class):&lt;BR /&gt;
&lt;BR /&gt;
//get position from vertexData&lt;BR /&gt;
kf.pos.x = vertexData[(indexData&lt;K&gt;-1)*3];&lt;BR /&gt;
kf.pos.y = vertexData[(indexData&lt;K&gt;-1)*3+1];&lt;BR /&gt;
kf.pos.z = vertexData[(indexData&lt;K&gt;-1)*3+2];&lt;BR /&gt;
&lt;BR /&gt;
everything fine so far, I just wanted to post this part of my code so you can see where I get my position data from.&lt;BR /&gt;
&lt;BR /&gt;
Furthermore I get the normal at that point of the edge through the faces they belong to. I get the data of this normal in a similar fashion: x is retrieved from the first component, y from the second and z from the third component like this:&lt;BR /&gt;
&lt;BR /&gt;
returnVec-&amp;gt;x = p_FaceNormals[closestVertex*3];&lt;BR /&gt;
returnVec-&amp;gt;y = p_FaceNormals[closestVertex*3+1];&lt;BR /&gt;
returnVec-&amp;gt;z = p_FaceNormals[closestVertex*3+2];&lt;BR /&gt;
&lt;BR /&gt;
Okay, now to the confusion:&lt;BR /&gt;
I am used to the following coordinate system (probably from using at school back then):&lt;BR /&gt;
+X is pointing to the right, +Y is pointing upwards and +Z is pointing towards you. According to the API documentation (topic Transient Geometry, at the paragraph on matrices as coordinate systems), Inventor is supposed to use that system, too.&lt;BR /&gt;
However, if I output the unchanged coordinates I retrieved from that Edge, +X seems to be pointing right, +Y towards you (hard to tell) and +Z upwards.&lt;BR /&gt;
Same for the normals I retrieved: I swap Y and Z coordinates in order to get into "my coordinate system"....&lt;BR /&gt;
&lt;BR /&gt;
Okay, that´s my problem: It would be great to _definitely know_ which coordinate system Inventor uses in that data I retrieve from an Edge with CalculateStrokes and from a Face with CalculateFacets. So, is it a left-handed or right-handed system, which directions are the axes pointing to?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for reading and answering.&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;</description>
      <pubDate>Mon, 01 May 2006 18:30:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629558#M159562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-01T18:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate system confusion</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629559#M159563</link>
      <description>Technically, the coordinate system Inventor uses is a right-handed &lt;BR /&gt;
coordinate system.  It's customary to show a right-handed coordinate system &lt;BR /&gt;
as you said; X is pointing towards the right, Y is pointing up, and Z is &lt;BR /&gt;
coming out towards you.  However, in reality all that is being specified is &lt;BR /&gt;
the X and Y are perpendicular to one another and Z is coming out of the &lt;BR /&gt;
plane defined by X an Y where the Z direction is defined using the &lt;BR /&gt;
right-hand rule.  That is if you point your fingers in the the direction of &lt;BR /&gt;
the X axis and then rotate them the 90 degress to the Y axis, your thumb is &lt;BR /&gt;
pointing in the direction of the Z axis.  A left-handed coordinate system &lt;BR /&gt;
would have the Z axis in the opposite direction.&lt;BR /&gt;
&lt;BR /&gt;
The coordinate system that you describe your coordinates coming back in are &lt;BR /&gt;
in a right-hand coordinate system so they are valid coordinates.  If you &lt;BR /&gt;
change your view orientation so that X is the right, Y is up, and Z is &lt;BR /&gt;
coming out then the results will probably make more sense to you.  It's just &lt;BR /&gt;
that "up", "left", and "right" are very subjective in a system where you can &lt;BR /&gt;
manipulate the view to any orientaion.  However, rotating the view does not &lt;BR /&gt;
change the coordinate system the part is based on.  It's just repositioning &lt;BR /&gt;
the virtual camera within that coordinate system.  Hopefully this makes some &lt;BR /&gt;
sense.&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Ekins&lt;BR /&gt;
Autodesk Inventor API&lt;BR /&gt;
&lt;BR /&gt;
&lt;MATCHES81&gt; wrote in message news:5159985@discussion.autodesk.com...&lt;BR /&gt;
Hi there!&lt;BR /&gt;
I´m quite confused about the coordinate system Inventor uses.&lt;BR /&gt;
&lt;BR /&gt;
I got a set of Edge objects from an EdgeCollection, which I get from the &lt;BR /&gt;
current selection, which works fine.&lt;BR /&gt;
On each of these Edge objects I call CalculateStrokes(). Now I lock the &lt;BR /&gt;
resulting SAFEARRAY to get a pointer to the array data. This array is then &lt;BR /&gt;
converted into a set of "Keyframe" objects (my own class):&lt;BR /&gt;
&lt;BR /&gt;
//get position from vertexData&lt;BR /&gt;
kf.pos.x = vertexData[(indexData&lt;K&gt;-1)*3];&lt;BR /&gt;
kf.pos.y = vertexData[(indexData&lt;K&gt;-1)*3+1];&lt;BR /&gt;
kf.pos.z = vertexData[(indexData&lt;K&gt;-1)*3+2];&lt;BR /&gt;
&lt;BR /&gt;
everything fine so far, I just wanted to post this part of my code so you &lt;BR /&gt;
can see where I get my position data from.&lt;BR /&gt;
&lt;BR /&gt;
Furthermore I get the normal at that point of the edge through the faces &lt;BR /&gt;
they belong to. I get the data of this normal in a similar fashion: x is &lt;BR /&gt;
retrieved from the first component, y from the second and z from the third &lt;BR /&gt;
component like this:&lt;BR /&gt;
&lt;BR /&gt;
returnVec-&amp;gt;x = p_FaceNormals[closestVertex*3];&lt;BR /&gt;
returnVec-&amp;gt;y = p_FaceNormals[closestVertex*3+1];&lt;BR /&gt;
returnVec-&amp;gt;z = p_FaceNormals[closestVertex*3+2];&lt;BR /&gt;
&lt;BR /&gt;
Okay, now to the confusion:&lt;BR /&gt;
I am used to the following coordinate system (probably from using at school &lt;BR /&gt;
back then):&lt;BR /&gt;
+X is pointing to the right, +Y is pointing upwards and +Z is pointing &lt;BR /&gt;
towards you. According to the API documentation (topic Transient Geometry, &lt;BR /&gt;
at the paragraph on matrices as coordinate systems), Inventor is supposed to &lt;BR /&gt;
use that system, too.&lt;BR /&gt;
However, if I output the unchanged coordinates I retrieved from that Edge, &lt;BR /&gt;
+X seems to be pointing right, +Y towards you (hard to tell) and +Z upwards.&lt;BR /&gt;
Same for the normals I retrieved: I swap Y and Z coordinates in order to get &lt;BR /&gt;
into "my coordinate system"....&lt;BR /&gt;
&lt;BR /&gt;
Okay, that´s my problem: It would be great to _definitely know_ which &lt;BR /&gt;
coordinate system Inventor uses in that data I retrieve from an Edge with &lt;BR /&gt;
CalculateStrokes and from a Face with CalculateFacets. So, is it a &lt;BR /&gt;
left-handed or right-handed system, which directions are the axes pointing &lt;BR /&gt;
to?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for reading and answering.&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/MATCHES81&gt;</description>
      <pubDate>Mon, 01 May 2006 20:37:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629559#M159563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-01T20:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate system confusion</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629560#M159564</link>
      <description>Thx for your answer!&lt;BR /&gt;
So Inventor is actually using a right-handed coordinate system. Good to know that. Am I correct that the only thing I have to do to convert right-handed to left-handed is to invert the 3rd component?</description>
      <pubDate>Mon, 01 May 2006 21:19:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629560#M159564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-01T21:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate system confusion</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629561#M159565</link>
      <description>Yes, the Z component is inverted.  Another difference between left and &lt;BR /&gt;
right-handed coordinate systems is that in a right-handed system positive &lt;BR /&gt;
rotations are Couterclockwise about the axis of rotation.  In a left-handed &lt;BR /&gt;
system, positive rotation is Clockwise.&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Ekins&lt;BR /&gt;
Autodesk Inventor API&lt;BR /&gt;
&lt;BR /&gt;
&lt;MATCHES81&gt; wrote in message news:5160282@discussion.autodesk.com...&lt;BR /&gt;
Thx for your answer!&lt;BR /&gt;
So Inventor is actually using a right-handed coordinate system. Good to know &lt;BR /&gt;
that. Am I correct that the only thing I have to do to convert right-handed &lt;BR /&gt;
to left-handed is to invert the 3rd component?&lt;/MATCHES81&gt;</description>
      <pubDate>Mon, 01 May 2006 21:29:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-system-confusion/m-p/1629561#M159565</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-01T21:29:13Z</dc:date>
    </item>
  </channel>
</rss>

