PDA

View Full Version : in Coordsys obj [Transform Matrix?]


thatoneguy
11-17-2010, 06:50 PM
I've got a little hiccup. I want a 3D position in another object's coordsys but even though I can feed it:


in coordsys obj $.pos

I can't seem to be able to do:

tim = $.pos
in coordsys obj tim

Any reason for that? Shouldn't both be equivalent? Is there a work around? Right now I'm creating a point and then deleting it which is awkward and wasteful.

temppoint = point position:tim
in coordsys obj temppoint.pos
delete temppoint

PiXeL_MoNKeY
11-17-2010, 07:18 PM
My guess is because you are asking for a point3 in relation to the obj, instead of what is the position of $ in the coordinate system of obj. From the Maxscript help:Accessing coordinate properties such as position, center, rotation axis, and so on, within a coordsys context causes those values to be delivered relative to the given coordsys. A point3 value isn't a property of the object.

-Eric

thatoneguy
11-17-2010, 07:37 PM
Oh right I was thinking of it backwards like

In Coordsys obj was a function modifying the point3 value. But it's a context so the actual function was calling the $.pos in that context.

If I just want to convert one transform into another object's local transform is there a matrix operation that would do that? Parenting is *. Would it be division?

PiXeL_MoNKeY
11-17-2010, 08:24 PM
From the Maxscript "Modifier Sub-Object Transform Properties" page:To convert from world to local coordinates, you multiple the world coordinates by the inverse of the node’s objecttransform matrix.Hope that helps,
-Eric

PiXeL_MoNKeY
11-18-2010, 03:59 PM
Another thought is use the Expose Transform (ExposeTm) Helper. It has script access to get/set the nodes, and you can retrieve the local/world values directly from it as well.

-Eric

CGTalk Moderation
11-18-2010, 03:59 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.