# Mirror position

51 views

### Eric Thivierge

Mar 20, 2012, 7:11:41 AM3/20/12
to soft...@listproc.autodesk.com
Hey all,

Wondering how I can mirror a transform's position without having to decompose the matrix into SRT and even further into the translation vector to multiply the X position value by -1. Not worried about converting space at this state so we can assume I'm working in the object's local transform space.

Am I stuck digging down into the matrix?

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

### Simon Anderson

Mar 20, 2012, 7:56:55 AM3/20/12
to soft...@listproc.autodesk.com
if i understand correctly you are wanting to take the matrix and perform an equation directly on the matrix that mirrors the position? a matrix multiplication that flips it right?

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Eric Thivierge [ethiv...@gmail.com]
Sent: Tuesday, March 20, 2012 1:11 PM
To: soft...@listproc.autodesk.com
Subject: Mirror position

### Eric Thivierge

Mar 20, 2012, 8:02:53 AM3/20/12
to soft...@listproc.autodesk.com
Yeah. I've tried multiplying a source matrix in ICE by one that has a negative X position value but its not working. I'm still working on my matrix math concepts. :\

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

### Dan Yargici

Mar 20, 2012, 8:08:15 AM3/20/12
to soft...@listproc.autodesk.com
Andy Nicholas dreams in matrices...

### Simon Anderson

Mar 20, 2012, 8:17:38 AM3/20/12
to soft...@listproc.autodesk.com
I havent done matricies in a while but i think if you multiple your matricy by

[1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[0,0,0,1]

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Dan Yargici [danya...@gmail.com]
Sent: Tuesday, March 20, 2012 2:08 PM
To: soft...@listproc.autodesk.com
Subject: Re: Mirror position

### Simon Anderson

Mar 20, 2012, 8:19:17 AM3/20/12
to soft...@listproc.autodesk.com
woops that was wrong LOL

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: Simon Anderson
Sent: Tuesday, March 20, 2012 2:17 PM
To: soft...@listproc.autodesk.com
Subject: RE: Mirror position

### Eric Thivierge

Mar 20, 2012, 8:19:23 AM3/20/12
to soft...@listproc.autodesk.com
Yeah I understand how to read them and set them but the math part of operations on matrices is what I'm probably struggling with. Guess I'm going to have to hit up kahn academy.

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

### Simon Anderson

Mar 20, 2012, 8:20:36 AM3/20/12
to soft...@listproc.autodesk.com
[-1,0,0,0]
[0,-1,0,0]
[0,0,-1,0]
[0,0,0,1]

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```
From: Simon Anderson
Sent: Tuesday, March 20, 2012 2:17 PM
To: soft...@listproc.autodesk.com
Subject: RE: Mirror position

### Eric Thivierge

Mar 20, 2012, 8:23:19 AM3/20/12
to soft...@listproc.autodesk.com
haha I tried multiplying it by:

[1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[-1,0,0,1]

hoping the -1 in the translation would do it but no dice. I don't want to mirror the whole transform just the position of the matrix

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

### Simon Anderson

Mar 20, 2012, 8:28:56 AM3/20/12
to soft...@listproc.autodesk.com
thats a scale inverse, but im guessing you want to do a rotation and position inverse. wheres my maths book when i need it XD

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```
Sent: Tuesday, March 20, 2012 2:23 PM

### Peter Agg

Mar 20, 2012, 8:29:56 AM3/20/12
to soft...@listproc.autodesk.com
If I'm getting what you mean correctly...

If you have a vector (5, 2, 5), then multiply it by

[-1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[0,0,0,1]

You'll get
(-5, 2, 5), inverting it just in the x axis. The second and third rows would do y and z respectively.

### Edy Susanto

Mar 20, 2012, 8:33:40 AM3/20/12
to soft...@listproc.autodesk.com
transform with the second matrix in the first matrix space and the
result is the "global" version of the second matrix.

-edy

On 3/20/2012 11:02 PM, Eric Thivierge wrote:
> Yeah. I've tried multiplying a source matrix in ICE by one that has a
> negative X position value but its not working. I'm still working on my
> matrix math concepts. :\
>
> --------------------------------------------
> Eric Thivierge
> http://www.ethivierge.com
>
>
> On Tue, Mar 20, 2012 at 10:56 PM, Simon Anderson
> <Simon.A...@triggerfish.co.za

> <mailto:Simon.A...@triggerfish.co.za>> wrote:
>
> if i understand correctly you are wanting to take the matrix and
> perform an equation directly on the matrix that mirrors the
> position? a matrix multiplication that flips it right?
>
> Simon Ben Anderson
> Triggerfish Studios
> http://www.triggerfish.co.za
>

> ------------------------------------------------------------------------
> *From:* softimag...@listproc.autodesk.com
> <mailto:softimag...@listproc.autodesk.com>
> [softimag...@listproc.autodesk.com
> <mailto:softimag...@listproc.autodesk.com>] on behalf of Eric
> Thivierge [ethiv...@gmail.com <mailto:ethiv...@gmail.com>]
> *Sent:* Tuesday, March 20, 2012 1:11 PM
> *To:* soft...@listproc.autodesk.com
> <mailto:soft...@listproc.autodesk.com>
> *Subject:* Mirror position

### Simon Anderson

Mar 20, 2012, 8:36:07 AM3/20/12
to soft...@listproc.autodesk.com
ahoy man, not sure if this will help, as you probabily have taken a look at this already but just incase you havent

http://en.wikipedia.org/wiki/Matrix_%28mathematics%29

Ill see if i can rattle my brains into action :)

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: Simon Anderson
Sent: Tuesday, March 20, 2012 2:28 PM
matrix-math.ppt

### Eric Thivierge

Mar 20, 2012, 8:43:13 AM3/20/12
to soft...@listproc.autodesk.com
Thanks Simon will have a read through,

Basically I want to do this without all the conversion and only using matrices. If its not possible so be it. Just shooting it out there to see if it was possible. :\

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

### Peter Agg

Mar 20, 2012, 8:50:23 AM3/20/12
to soft...@listproc.autodesk.com
Yep, if you get the null1 global kine, multiply it by the matrix I posted above then it'll mirror in X just fine. Just tested myself.

I'd post a picture but, well, it's 3 nodes and doesn't show much. :)

### Michal Doniec

Mar 20, 2012, 8:51:34 AM3/20/12
to soft...@listproc.autodesk.com
http://ndu2009algebra.blogspot.co.uk/2011/05/mirroring-point-on-3d-plane.html

That should help, matrix version is at the bottom.
I have ICE version, but it too big to fit on the screen, not sure if you can decipher it.
--
----------
Michal
mirror_matrix.JPG

### Simon Anderson

Mar 20, 2012, 8:52:14 AM3/20/12
to soft...@listproc.autodesk.com

hey, so i bashed around some numbers, not sure if its what will work but have a try

look at attached it seems to work

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```
Sent: Tuesday, March 20, 2012 2:43 PM
Matrix.jpg

### Simon Anderson

Mar 20, 2012, 8:57:35 AM3/20/12
to soft...@listproc.autodesk.com
Should of explained the image a bit better:

Have two nulls both rotated, and parented under the scene root,
Original null called 'null' which one can move and rotate, then the inverse ICE driven null called 'Mover'

just did a test i have inverted the motion of the forward X axis, so just change it to

[1,0,0,0]
[0,1,0,0]
[0,0,-1,0]
[,0,0,1]

and that should do the job

### Simon Anderson

Mar 20, 2012, 9:00:40 AM3/20/12
to soft...@listproc.autodesk.com
missed a 0, sorry about all the mistakes in my emails, still at work and its my last week so smashing out the bugs here and trying to setup future plans, and helping out UBER multitasking lol

let me know if this does the job or if it doesn't ill try something else

[1,0,0,0]
[0,1,0,0]
[0,0,-1,0]
[0,0,0,1]

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: Simon Anderson
Sent: Tuesday, March 20, 2012 2:57 PM

To: soft...@listproc.autodesk.com
Subject: RE: Mirror position

### Alok Gandhi

Mar 20, 2012, 9:23:08 AM3/20/12
to soft...@listproc.autodesk.com
Just decompose into vectors and invert the first vector from your transform matrix and pack again

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1831 / Virus Database: 2090/4557 - Release Date: 10/17/11
Internal Virus Database is out of date.

### Simon Anderson

Mar 20, 2012, 9:32:41 AM3/20/12
to soft...@listproc.autodesk.com
Mirror Matrix:

Input Matrix A (original Local or Global Kinematics), Multiple by a 4D Matrix and have the Matrix setup to be

[1,0,0,0]
[0,1,0,0]
[0,0,-1,0]
[0,0,0,1]

This will mirror rotations, scale, and location.

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Alok Gandhi [alok....@modusfx.com]
Sent: Tuesday, March 20, 2012 3:23 PM

To: soft...@listproc.autodesk.com
Subject: Re: Mirror position

### Simon Anderson

Mar 20, 2012, 10:55:08 AM3/20/12
to soft...@listproc.autodesk.com
Thought I would create a nice explanation quickly, as I realised my previouse example didn't take into account parented objects that need to be driven.

any questions just let me know

```Simon Ben Anderson
Triggerfish Studios
http://www.triggerfish.co.za```

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Simon Anderson [Simon.A...@triggerfish.co.za]
Sent: Tuesday, March 20, 2012 3:32 PM
Matrix_example.jpg

### Sandy Sutherland

Mar 20, 2012, 11:06:25 AM3/20/12
to soft...@listproc.autodesk.com
Cough..............get back to work Simon..................  ;^)

[giggles on an afternoon off]

S.

_____________________________
Sandy Sutherland
Technical Supervisor
sandy.su...@triggerfish.co.za
_____________________________

Sent: 20 March 2012 16:55

### Simon Anderson

Mar 20, 2012, 11:14:51 AM3/20/12
to soft...@listproc.autodesk.com
A YOU! stop working and enjoy your afternoon off  HAHAHA!! :D

```Simon Ben Anderson