[Closed] translating point3 value to specific matrix3
Hi everyone! had a quick MaxScript question.
say if i wanted to get the position of objectB, from (in relation) to objectA, i would use…
in coordsys objectA (objectB) = point3 value (relative to objectA)
however, if i were to use the same method using an actual point3value, rather then object.pos…
in coordsys objectA (point3Value) = point3Value (not relative to objectA)
basically i am looking for ways “translating” point3 position from world, to point3 position value relative to a specific object.
can anybody please help me out?
thank you very much in advance : )
what you want to do is create a new vector from A to B. the formula for that is AB = B – A. for example:
A = [1,2,3]
B = [4,5,6]
AB = B - A
-- [3,3,3]
and of course you can reverse this by adding AB to A to get B in world space again
relativePos = obj2.position * inverse obj1.transform
This gets the position of obj2 in obj1 space, same as if it was parented to that object.
-Johan
Seems I didn’t read your post correctly… Johan’s response is what you want
Thank you both for your prompt response : )
it did indeed work!
and for anyone running into this post,
if you want to go back to the world TM, re multiply by the object TM
back to WorldPos = obj2.position * obj1.transform
again thank you all : )