Matrix transformation


I found a strange thing,

IPoint3 vertObjectSpace = mesh.GetVert(vertID);

This position is not in the world space.This is totally different from mxs.So we have to deal with it in the following way:

IMatrix3 tmObj2World= i.GetObjectTM(0, iTimeRange); // where i is your IINode
IPoint3 vertWorldSpace = tmObj2World.PointTransform(vertObjectSpace);

If we subtract these two values.The above method is really not simple, and there are accuracy problems.Ask the experts if there is an easier and more formal way.


There is no easier way if you want to do it “like in the SDK” (in your case the .net approach is used). MaxScript has several contexts to help you get some transformations in the specified coordinate system. But SDK methods are usually in a specific space, so you need to transform the result to the right space yourself. There are no problems with accuracy, except that all calculations are in float values, which is well known.
Accuracy is good enough, as long as you don’t do modeling microchip or galaxy working in real-world units. :wink:


Thank you for your reply. I am afraid I will go astray, so I ask…