Notifications
Clear all
[Closed] Convert coordinates from world space to local/parent space
Feb 07, 2006 9:09 pm
Hi!
I’m new to MaxScript and I’m looking for a way to convert coordinates from world space into an object’s local coordinate system. For example, selecting a point by
p1 = pickPoint()
always returns the coordinates of p1 in world space coordinates. How can I convert p1 that it’s coordinates refer to the currently selected object?
Thank you!
Chris
2 Replies
1 Reply
Multiply the point with the inverse of the object’s transformation matrix.
p1 = pickPoint()
p1 *= inverse yourObject.transform
Rule of thumb:
Local Point * yourObject.transform -> world coordinates
World Point * inverse yourObject.transform -> back to local