How can I get the points' coordinate of mesh objects correctly?

How can I get the points' coordinate of mesh objects correctly?

Anonymous
Not applicable
1,077 Views
1 Reply
Message 1 of 2

How can I get the points' coordinate of mesh objects correctly?

Anonymous
Not applicable

Recently,I use 3ds Max 2017 Python API to make programme.But something really makes me confused.

For example, I create a cuboid in the interface. Then I draw another same cuboid at different place. I turnd them to TriObject, then I used GetMesh() to turn them to mesh and get the points' coordinates . To my surprise, the coordinate of their points are totally same. Why?Is it because I turned them to mesh? How can I get the correct coordinate relative to (0,0,0)?

 

The photos below are my objects in 3dmax and a part of the code. The result is that the two sets of coordinates are exactly the same.Why?

QQ图片20190128181211.png

QQ图片20190128181809.png

0 Likes
Accepted solutions (1)
1,078 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Point coordinate for a mesh is returned in an object's local transform space.
In your case, coordinates will be the same.
If you want to get a point coordinate in world space you should either multiply point position by an object's global transform matrix or 'freeze' object's transform.

0 Likes