Message 1 of 4
Coordinate system confusion
Not applicable
05-01-2006
11:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there!
I´m quite confused about the coordinate system Inventor uses.
I got a set of Edge objects from an EdgeCollection, which I get from the current selection, which works fine.
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):
//get position from vertexData
kf.pos.x = vertexData[(indexData-1)*3];
kf.pos.y = vertexData[(indexData-1)*3+1];
kf.pos.z = vertexData[(indexData-1)*3+2];
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.
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:
returnVec->x = p_FaceNormals[closestVertex*3];
returnVec->y = p_FaceNormals[closestVertex*3+1];
returnVec->z = p_FaceNormals[closestVertex*3+2];
Okay, now to the confusion:
I am used to the following coordinate system (probably from using at school back then):
+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.
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.
Same for the normals I retrieved: I swap Y and Z coordinates in order to get into "my coordinate system"....
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?
Thanks for reading and answering.
I´m quite confused about the coordinate system Inventor uses.
I got a set of Edge objects from an EdgeCollection, which I get from the current selection, which works fine.
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):
//get position from vertexData
kf.pos.x = vertexData[(indexData
kf.pos.y = vertexData[(indexData
kf.pos.z = vertexData[(indexData
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.
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:
returnVec->x = p_FaceNormals[closestVertex*3];
returnVec->y = p_FaceNormals[closestVertex*3+1];
returnVec->z = p_FaceNormals[closestVertex*3+2];
Okay, now to the confusion:
I am used to the following coordinate system (probably from using at school back then):
+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.
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.
Same for the normals I retrieved: I swap Y and Z coordinates in order to get into "my coordinate system"....
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?
Thanks for reading and answering.