# Expressing point positions in reference to another object's Matrix?

79 views

### Eric Thivierge

May 25, 2011, 2:22:06 PM5/25/11
to soft...@listproc.autodesk.com
If I have a sphere and I want to get the point positions from the sphere and see what their point positions are in reference to another null's transforms how would I do that? Can't wrap my head around it...

What I'm aiming to do is to replicate Maya's Squash deformer using a null. Trying to have is so I can reposition the null and from whatever position it is in the squash happens based on that position.

Any help is appreciated.

--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com

### Grahame Fuller

May 25, 2011, 2:28:57 PM5/25/11
to soft...@listproc.autodesk.com
Convert the sphere's point positions to global by multiplying by sphere.kine.global. Then convert to the null's local by multiplying by the inverse of null.kine.global.

gray

winmail.dat

### Guillaume Laforge

May 25, 2011, 2:31:01 PM5/25/11
to soft...@listproc.autodesk.com
Hi Eric,

Express the sphere point position in world space : PointPosition * Self.Kine.Global = GlobalPointPosition
Then Express sphere point positions in the Null space : GlobalPointPosition * Invert of Null.Kine.Global

Guillaume

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Eric Thivierge
Sent: Wednesday, May 25, 2011 2:22 PM
To: soft...@listproc.autodesk.com
Subject: Expressing point positions in reference to another object's Matrix?

winmail.dat

### Grahame Fuller

May 25, 2011, 2:31:33 PM5/25/11
to soft...@listproc.autodesk.com
First!
winmail.dat

### Guillaume Laforge

May 25, 2011, 2:32:42 PM5/25/11
to soft...@listproc.autodesk.com
Damn !

:)

winmail.dat

### Matt Lind

May 25, 2011, 2:36:00 PM5/25/11
to soft...@listproc.autodesk.com

The easy way is to use XSIMath.MapObjectPoseToObjectSpace() or XSIMath.MapObjectPositionToObjectSpace() depending on what components you want to remap.

If you’d rather do the math yourself, you can multiply the points’ positions by the sphere’s global transform to convert to global space, then multiply that result by the inverse of the null’s global transform to convert to the null’s local space.

Matt

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Eric Thivierge
Sent: Wednesday, May 25, 2011 11:22 AM
To: soft...@listproc.autodesk.com
Subject: Expressing point positions in reference to another object's Matrix?

If I have a sphere and I want to get the point positions from the sphere and see what their point positions are in reference to another null's transforms how would I do that? Can't wrap my head around it...

### Eric Thivierge

May 25, 2011, 2:35:12 PM5/25/11
to soft...@listproc.autodesk.com
Very cool thanks. Was plugging nodes in left and right with variations and apparently missed that one. Thanks to both of you!

--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com

### Alan Fregtman

May 25, 2011, 2:40:09 PM5/25/11
to soft...@listproc.autodesk.com
Speaking of Squash deformers, Cesar Saez made an ICE one a while back.

Perhaps there's something to be learnt from exploring its guts:
http://vimeo.com/groups/ice/videos/3827160

The compounds', that is. :p

### Eric Thivierge

May 25, 2011, 2:40:00 PM5/25/11
to soft...@listproc.autodesk.com
Thanks Matt,

Working with ICE so the suggestions above are what I was working for. Sorry for not stating that. Good to have the info logged for scripting too.

--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com

### Grahame Fuller

May 25, 2011, 2:43:42 PM5/25/11
to soft...@listproc.autodesk.com
Actually it will be a bit faster to multiply sphere.kine.global by the inverse of null.kine.global first (in that order), and then multiply by the sphere's point positions.

gray

winmail.dat

### Eric Thivierge

May 25, 2011, 2:42:36 PM5/25/11
to soft...@listproc.autodesk.com
Uh, OK so it's been done. :) Great thanks Alan, I'll investigate!

--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com