Issue mirror transformation

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2013   #1
Issue mirror transformation

I never really had any issue mirror rotation until I stumbled onto this:
how to "mirror" those 2 points:
Code:
point transform:(matrix3 [-0.0744505,0.102782,-0.991914] [0.900617,-0.420165,-0.111136] [-0.42819,-0.901608,-0.061286] [-41.0417,2.50814,301.575]) name:"LeftPoint" point transform:(matrix3 [0.110613,0.061457,-0.991962] [0.958345,0.257846,0.122839] [0.263323,-0.964229,-0.030376] [41.0417,2.50804,301.575])name:"Rightoint"


What I'm actually looking for is to mirror the local X axix rotation value

so let's say that point001 is rotated 15 degree on the x axis I need to have the opposite roll value on the other side.

I need to keep the overall same direction (don't flip axis) SHould I just mirror the whole thing and fix the axis back as to how I want them ?
 
Old 11 November 2013   #2
quick and dirty method

Code:
tm = $.transform; tm[1] *= -1; $.transform = tm;


sorry just read the final part of your post but to actually "mirror" you need to flip an axis otherwise your just rotating 180 degrees around the z axis which is not the same ?

Code:
$.transform = ((eulerangles 0 0 180) as matrix3) * $.transform

or
Code:
$.transform = prerotateZ $.transform 180;

which is the same thing and the same as rotating 180 degrees about the local z axis in the viewport and very similar to the axis flip above but with the additional flipping of the y axis.

Last edited by Klunk : 11 November 2013 at 08:59 PM.
 
Old 11 November 2013   #3
thanks, but those solution doesn't give me the desired result

I managed to get the desired "mirror" effect using this function
Code:
fn MirrorRollAxis Source Target = ( pointParent = point name:"Point_Parent" pointSource = point name:"Point_Source" pointSource.parent = pointParent pointSource.transform = Source.transform pointParent.transform = prescale pointParent.transform [-1,1,1] pointSource.transform = prescale pointSource.transform [1,-1,1] target.transform = pointSource.transform delete pointParent;delete pointSource )

But I dont like having to create node just to get the desired result :/
 
Old 11 November 2013   #4
post the scene and say what objects you want to mirror

(please give a file with max version <= 2012)
 
Old 11 November 2013   #5
the situation might vary. it depends on:
# are mirroring objects children of the same parent
# are they originally flipped against each other
# can they be translated (rotated, scale)
# etc.

the math is simple... you have to multiply transform one with mirror matrix.
for x axis in absolute coordinate system it's:
Code:
x_mirror_tm = matrix3 [-1,0,0] [0,1,0] [0,0,1] [0,0,0] delete objects p1 = point name:"R point" pos:[10,0,10] rotation:(eulerangles 45 60 70) axistripod:on box:on cross:off wirecolor:green p2 = point name:"L point" axistripod:on box:on cross:off wirecolor:yellow p2.transform = p1.transform*x_mirror_tm

Last edited by denisT : 11 November 2013 at 10:03 PM.
 
Old 11 November 2013   #6
Quote:
Originally Posted by mrfred
Code:
point transform:(matrix3 [-0.0744505,0.102782,-0.991914] [0.900617,-0.420165,-0.111136] [-0.42819,-0.901608,-0.061286] [-41.0417,2.50814,301.575]) name:"LeftPoint" point transform:(matrix3 [0.110613,0.061457,-0.991962] [0.958345,0.257846,0.122839] [0.263323,-0.964229,-0.030376] [41.0417,2.50804,301.575])name:"Rightoint"


I need to keep the overall same direction (don't flip axis)


in your case the method should be modified a little:
Code:
x_mirror_tm = matrix3 [-1,0,0] [0,1,0] [0,0,1] [0,0,0] delete objects p3 = point transform:(matrix3 [-0.0744505,0.102782,-0.991914] [0.900617,-0.420165,-0.111136] [-0.42819,-0.901608,-0.061286] [-41.0417,2.50814,30.575]) name:"LeftPoint" wirecolor:red p4 = point transform:(matrix3 [0.110613,0.061457,-0.991962] [0.958345,0.257846,0.122839] [0.263323,-0.964229,-0.030376] [41.0417,2.50804,30.575]) name:"Rightoint" wirecolor:blue p5 = copy p3 transform:(p3.transform*x_mirror_tm) wirecolor:orange p5.transform = prescale p5.transform [1,-1,1] resetscale p5
 
Old 11 November 2013   #7
or ...
Code:
x_mirror_tm = matrix3 [-1,0,0] [0,1,0] [0,0,1] [0,0,0] delete objects p3 = point transform:(matrix3 [-0.0744505,0.102782,-0.991914] [0.900617,-0.420165,-0.111136] [-0.42819,-0.901608,-0.061286] [-41.0417,2.50814,30.575]) name:"LeftPoint" wirecolor:red --p4 = point transform:(matrix3 [0.110613,0.061457,-0.991962] [0.958345,0.257846,0.122839] [0.263323,-0.964229,-0.030376] [41.0417,2.50804,30.575]) name:"Rightoint" wirecolor:blue p5 = copy p3 transform:((prescale p3.transform [1,-1,1])*x_mirror_tm) wirecolor:orange
 
Old 11 November 2013   #8
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:00 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.