I suppose everyone of us is experimenting such feelings sometimes, but I definitely doesn1t consider you being a noob. Just keep working...mak_kawa wrote: ↑December 6th, 2019, 11:53 am No, I have a feeling that I am still a noob in Rainmeter world.
I am always stumbling on RegExp, IfCondition, Substitute, !EnableMeasure...every day, every time I write/modify Rainmeter code.
"Why, why doesn't this code work?!"
"Where does this error come from?"
"I can't figure out!!"
It is currently April 26th, 2024, 3:41 am
shapes and average
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: shapes and average
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: shapes and average
No, it's not at all. It's pure mathematics. And math is my (our?) friend.
-
- Posts: 943
- Joined: May 7th, 2016, 7:32 am
Re: shapes and average
I for one, welcome our transformationmatrix overlord.
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery
There are many ways to be different - there is only one way to be yourself - be amazing at it
The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
There are many ways to be different - there is only one way to be yourself - be amazing at it
The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: shapes and average
And here is the promised example. The following skin has an initially not rotated yellow rectangle. You can set the coordinates of the center of rotation, through the CenterX and CenterY variables. Take care these coordinates are relative to the position of the [MeterTransformationMatrix] meter. For instance for CenterX=0 and CenterY=0 you'll get the meter rotated around its upper left corner.
You also have to set the rotation angle. Note that a positive angle means anticlockwise rotation, while a negative angle means clockwise rotation.
If you click the yellow rectangle, you get it rotated.
The code:
Code: Select all
[Rainmeter]
Update=-1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,100
SkinWidth=450
SkinHeight=350
[Variables]
Angle=-30
CenterX=125
CenterY=75
Rotate=0
[MeterTransformationMatrix]
Meter=Image
SolidColor=255,240,0
X=100
Y=100
W=250
H=150
TransformationMatrix=(Cos(Rad(#Angle#*#Rotate#)));(-Sin(Rad(#Angle#*#Rotate#)));(Sin(Rad(#Angle#*#Rotate#)));(Cos(Rad(#Angle#*#Rotate#)));((#CenterX#+[MeterTransformationMatrix:X])-((#CenterX#+[MeterTransformationMatrix:X])*Cos(Rad(#Angle#*#Rotate#)))-((#CenterY#+[MeterTransformationMatrix:Y])*Sin(Rad(#Angle#*#Rotate#))));((#CenterY#+[MeterTransformationMatrix:Y])+((#CenterX#+[MeterTransformationMatrix:X])*Sin(Rad(#Angle#*#Rotate#)))-((#CenterY#+[MeterTransformationMatrix:Y])*Cos(Rad(#Angle#*#Rotate#))))
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Rotate "(1-#Rotate#)"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
-
- Posts: 81
- Joined: October 25th, 2019, 1:20 am
Re: shapes and average
balala wrote: ↑December 6th, 2019, 9:11 pm And here is the promised example. The following skin has an initially not rotated yellow rectangle. You can set the coordinates of the center of rotation, through the CenterX and CenterY variables. Take care these coordinates are relative to the position of the [MeterTransformationMatrix] meter. For instance for CenterX=0 and CenterY=0 you'll get the meter rotated around its upper left corner.
You also have to set the rotation angle. Note that a positive angle means anticlockwise rotation, while a negative angle means clockwise rotation.
If you click the yellow rectangle, you get it rotated.
The code:Don't be afraid of the above code, it's not so complicated as it seems at a first look. Feel free to ask if you can't figure out something related to the code.Code: Select all
[Rainmeter] Update=-1 AccurateText=1 BackgroundMode=2 SolidColor=0,0,0,100 SkinWidth=450 SkinHeight=350 [Variables] Angle=-30 CenterX=125 CenterY=75 Rotate=0 [MeterTransformationMatrix] Meter=Image SolidColor=255,240,0 X=100 Y=100 W=250 H=150 TransformationMatrix=(Cos(Rad(#Angle#*#Rotate#)));(-Sin(Rad(#Angle#*#Rotate#)));(Sin(Rad(#Angle#*#Rotate#)));(Cos(Rad(#Angle#*#Rotate#)));((#CenterX#+[MeterTransformationMatrix:X])-((#CenterX#+[MeterTransformationMatrix:X])*Cos(Rad(#Angle#*#Rotate#)))-((#CenterY#+[MeterTransformationMatrix:Y])*Sin(Rad(#Angle#*#Rotate#))));((#CenterY#+[MeterTransformationMatrix:Y])+((#CenterX#+[MeterTransformationMatrix:X])*Sin(Rad(#Angle#*#Rotate#)))-((#CenterY#+[MeterTransformationMatrix:Y])*Cos(Rad(#Angle#*#Rotate#)))) DynamicVariables=1 LeftMouseUpAction=[!SetVariable Rotate "(1-#Rotate#)"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: shapes and average
Do you find it complicated? Because it's not too much...
-
- Posts: 81
- Joined: October 25th, 2019, 1:20 am
Re: shapes and average
Its working perfectly
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: shapes and average
I'm glad.