Notifications
Clear all

[Closed] mirroring orientation

Hey ladies and germs, my question for this week revolves around mirroring orientation (hence the title).
What I’m trying to do is get the orientation of an object and apply its mirrored value to another object. At this stage I do it by getting the eulerangles of an object and applying it to another object and making the appropriate axis an inverse value. However, this all falls down if someone changes the axis order of the object.
How can I script a solution to get the mirrored orientation of an object and apply it to another and still have it work if the axis order (or the controller for that matter) is changed?
:¬)

8 Replies
 PEN

Well brad have a look at Maxine, there is a function built into here that mirrors matrix values and is stored in a CA def.

I also just added a very simple solution to my 4th DVD where I use quat values to do just this. Maxines solution is far more robust and I would suggest that you have a look at it.

Cool. Thanks Paul, I’ll look into it.
Your Maxine rig seems to be gaining legendary status around here. It’s about time I took it apart!
:¬)

Yikes Paul, I just got around to looking into your mirroring CAs in Maxine and what little I know about maxscript, I know so much less about transform matrices.
I’ve tried looking into how they work and the best thing I can find is the tutorial on your website.
I’m sure with a bit of elbow grease I can work out what the four matrix3 rows mean specifically but how do I apply those values on to another object? I can only seem to find out how to extract the values, not apply them.
:¬)

 PEN

Have you looked at the working model of the matrix on my site?

There is also this newer one.

http://paulneale.com/tutorials/matrix/matrixModel.zip

Most people confuse how it works. There are 4 point3 values, the last one is the position of the object. Most people assume that the other three are then the rotation, well they are sort of but they are not rotation values. They are also all position values. Take the first value, this is the X vector, on a default object that isn’t rotated it is [1,0,0] which is one unit long from [0,0,0], this vector should remain one unit long if the model has not been scaled. Y is also one unit long but in the Y direction so [0,1,0]. Using trig you can get the angles between the center at [0,0,0], X at [1,0,0] and Y at [0,1,0]. You can then do the same for Z at [0,0,1]. To rotate the object around Z you need to move the X and the Y vectors keeping them at right angles to each other. If you don’t keep them at right angles you skew the matrix and there for the mode. This would be refered to as a non-orthoganalized matrix. To scale the object along the X axis by two times you move the X vector to [2,0,0]. Because the X,Y and Z vectors are used to determine both the rotation and the scale of a model, scaling is a bad idea as the rotation will skew.

Not sure if any of this is making any sense but it is actualy rather simple once you get the full idea of how it works.

Hi All,

Paul thanks for the matrixModel scene, I think I understood it enough to have a go at writing my own simple script that mirrors rotation. I eventally want to use this in my rigs to mirror FK arm poses from right arm to left arm and visa versa.

This is my first attempt at touching matrix3 values, if anyones interested could they have a look and maybe tell me if its on the right track?

Cheers

Dan

very cool pen, that helps a lot as I’m just starting to add pose mirroring to my rigs as well

 PEN

Bobo’s new DVD will be a must for people wanting to learn this stuff or just trying to learn more. Being able to deal with all your transforms at the matrix level is the best way to go about it. Once you get the hang of it converting objects from the space of one into another is easy.

I think that Bobo’s DVD is getting close to being released and I’m hopping to get the first one hot off the press…burner;)

great news paul, this one will find a place on my shelf for sure