Mirror Matrix

free scripts, plugins, models, textures
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Mirror Matrix

Post by clintonman »

New mirror tool that operates on the item matrix.
The built in mirror tool is a modeling tool so only effects the vertices of an object.
This Mirror Matrix tool operates on the matrix of an object as well as the vertices. This tool can be used with cameras and lights.
Another difference is that this tool will only mirror across the major XYZ axes and not an arbitrary plane like the modeling mirror tool.


Mirror Matrix script can be found about 1/3 way down on this page:

http://clintons3d.com/plugins/truespace ... index.html


Edit: Re-uploaded with a forgotten copy option and fixed typo in the installer messaging

MirrorMatrixResults.jpg
All cubes mirrored across the x axis. All cubes on the left are the mirrored result. All cubes on the right are the original cubes. The effect can be seen with the new object centered nav widget. The cage widget shows the selected cubes. Orange more or less indicates the rotation center.

Far cube has a pivot - the pivot and mesh center(orange) did not mirror, only the vertices mirrored
Middle cube has no pivot - mesh center(orange) did not mirror
Near cube was Matrix Mirrored - matrix and mesh center mirrored succesfully
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

Can you explain how to use this Mirror Matrix script with a simple unmodified trueSpace primitive Cube?
One of the things that I do not understand is why the selected Cube is moved and not the copied object.
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

trueBlue wrote: 25 Mar 2020, 14:42 Can you explain how to use this Mirror Matrix script with a simple unmodified trueSpace primitive Cube?
One of the things that I do not understand is why the selected Cube is moved and not the copied object.
From the website:
"Select a scene item then choose an axis and press the Mirror button. "

To keep it as a cube primitive you would uncheck "Mirror Mesh Vertices"

The object is copied and the original object is mirrored. The trueSpace copy command does not select the copied item so the original is mirrored.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

I actually experimented with that.
It is possible to select the copied object.

Code: Select all

var sel = Node.FirstSelected()
var copy = Node.Copy(sel, Node.Owner(sel))
Space.Select(copy)
If I then change sel to copy for the rest of your code following the Copy command, it does seem to work.

If I do not use
MeshModifiers.InvertSelection('')
in your Flip Normals script, I do not get hidden faces
HiddenFaces.png
HiddenFaces.png (24.96 KiB) Viewed 3985 times
copied object rotated to show hidden faces
Attachments
MirrorMatrix.RsObj
(45.47 KiB) Downloaded 194 times
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

trueBlue wrote: 25 Mar 2020, 17:39 I actually experimented with that.
It is possible to select the copied object.

Code: Select all

var sel = Node.FirstSelected()
var copy = Node.Copy(sel, Node.Owner(sel))
Space.Select(copy)
If I then change sel to copy for the rest of your code following the Copy command, it does seem to work.

If I do not use
MeshModifiers.InvertSelection('')
in your Flip Normals script, I do not get hidden faces
HiddenFaces.png
copied object rotated to show hidden faces
If you do that then you should probably also change the general copy button and the modeling mirror copy button so they're all consistent.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

Update March 25:

bug fixed in the pivot - must flattened the vertices when the object has a pivot

bug shows itself when trying to snap an object to a vertex selection of a mirrored object that has a pivot. It ends up snapping well away from the geometry.

Code: Select all

MeshModifiers.FlattenAxes('');
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

Update November 2020

works with multiple selections
updated the installer
works with the new not yet released nurbs objects
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

Default primitive cube that has not been point edited
Mirror Matrix with Mirror Copy & Mirror Mesh Vertices, checked
Mirror X
Answered Yes to edit mesh
Mirror Matrix Error.png
Mirror Matrix Error.png (33.87 KiB) Viewed 3440 times
Besides the error, is this new update PE only?
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

trueBlue wrote: 25 Nov 2020, 18:19 Default primitive cube that has not been point edited
Mirror Matrix with Mirror Copy & Mirror Mesh Vertices, checked
Mirror X
Answered Yes to edit mesh
Mirror Matrix Error.png

Besides the error, is this new update PE only?
Fixed the error. There was a missing return statement that should have stopped it from getting to the "edit mesh" question.
No, it's not for PE mode.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

Thanks!
Why do you get this Alert?
Cube Mirror X.png
It seems that Z is the only one that works like you would expect
XYZ.png
X & Y just seems to Copy
Can you give a simple example how to use this with a simple Cube?
Post Reply