Notifications
Clear all

[Closed] Convert coordinates from world space to local/parent space

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
(@bobo)
Joined: 11 months ago

Posts: 0

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

Thank you! You helped me very much!