It is currently September 20th, 2019, 9:12 pm

TransformationMatrix ~ Layman Terms

Discussion about the documentation, main Rainmeter site and forums.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

TransformationMatrix ~ Layman Terms

eclectic-tech » July 25th, 2014, 9:09 pm

Offering a suggested addition to the TransformationMatrix general options in the documentation... This is explained in the text, but not put into the actual format of the TransformationMatrix command.

Add my layman explanation of the effect each of the 6 numbers has on the meter:

TransformationMatrix={scale x};{skew x};{skew y};{scale y};{move x};{move y}

- - - - - - -
example documentation wrote: TransformationMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Default: 1;0;0;1;0;0
Defines a 3x2 matrix which can be used to transform the meter. Transformations include: scaling, skewing, and translating (ie. moving). There must be exactly 6 values separated by semicolons ;.

TransformationMatrix={scale x};{skew x};{skew y};{scale y};{move x};{move y}

Combining these can have drastic effects on the meter it is applied to.

See also: Transformation Matrix

Examples:

TransformationMatrix=-1; 0; 0; 1; 40; 0: This will flip X along the line X=20.
TransformationMatrix=1; 0; 0; -1; 0; 100: This will flip Y along the line Y=50.
TransformationMatrix=0.5; 0; 0; 1; 25; 0: This will scale X by 0.5 at X=50.
Note: All transformations are relative to the top left corner of the window and not to the meter itself. So if you want to rotate the meter by its center the translation component in the matrix must be relative to the top left corner of the window.

Also note that the even if the meter's visual location and orientation is changed by the transformation the place where it would be located without the transformation will still be used to define the window size and register the mouse clicks. This might change in the future though.
- - - - - -

I found it much easier to use the TransformationMatrix by thinking in these terms. And it helped me better understand Alex2539's excellent TransformationMatrix Guide.

Perhaps other "laymen" will be helped and be better able to utilize this powerful, but difficult to grasp tool!

P.S. You might also consider including iNjUST's* universal zoom using transformationmatrix formula and a #zoom# variable:
TransformationMatrix=#zoom#;0;0;#zoom#;((1-#zoom#)*[#CURRENTSECTION#:X]);((1-#zoom#)*[#CURRENTSECTION#:Y])
DynamicVariables=1]


* I believe iNjUST first suggested it in the linked post from a year ago!
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: TransformationMatrix ~ Layman Terms

jsmorley » July 25th, 2014, 9:23 pm

Added your "layman's" parameter / format mask. Thanks.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: TransformationMatrix ~ Layman Terms

eclectic-tech » July 25th, 2014, 10:34 pm

Looks good... Thanks for considering the addition! :thumbup:

You might consider also adding it to the 3.1 documentation... :oops:
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: TransformationMatrix ~ Layman Terms

jsmorley » July 26th, 2014, 12:29 am

It's there on both. Be sure you refresh.


Sent from my Kindle Fire HDX