Notifications
Clear all
[Closed] getVert Get weird Coordinates
Aug 12, 2016 5:00 pm
Hi all
I’m C# DLL to get mesh point coordinates.
IPoint3 point = myMesh.GetVert( vertid );
but I get
X: 6.16883d0, Y:1.90735d-006, Z:4.44051d0
But in 3ds MAX (and maxscript) the point is [9.87013,-4.41558,5.74244 ]
When do a debug in Visual Studio the myMesh.GetVert get the wrong coordinates… the vertID is correct
What i’m missing??
Thanks
4 Replies
Aug 12, 2016 5:00 pm
sure about that?
MXS is using 1-based indices
SDK is using 0-based indices
Aug 12, 2016 5:00 pm
You right VertID comes from maxscript change it but is the same get weird coordinates.
IPoint3 point = myMesh.GetVert( vertid-1 );
Maybe need to multiply with node Transform Matrix?
Who do that in C#?
Aug 12, 2016 5:00 pm
I do some tests and the Getvert return coordinates relative to center of object.
How to return world position?
Aug 12, 2016 5:00 pm
Ok get it to work!
Need to multiply with node Matrix.
....
IMatrix3 nodeTM= myNode.GetNodeTM(0,null);
IPoint3 point = myMesh.GetVert(vertID);
IPoint3 pointTM = nodeTM.PointTransform(point); //World Position point