Definitely you're right, it's not. But neither isn't impossible to be use. Especially that the Transformation Matrix Guide is a very good description.fonpaolo wrote:...however, even if I'm sure that TrasformationMatrix is very useful, it's not the easiest option to use.
It is currently April 26th, 2024, 2:25 am
Album cover animations: Help
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
-
- Posts: 28
- Joined: April 6th, 2017, 2:43 pm
Re: Album cover animations: Help
Here it isbalala wrote:I didn't understand from the posted image what's happened, but if you still have errors using the rotator meter(s), you could try to switch to a simple image meter and rotate it with a TransformationMatrix (well, I have to admit that since the moment I understood how this option works, I became a huge "fan" of it).
If you're interested, please post the last code you have. Additionally I just mention that I don't use Spotify, but just post your code, as it is right now.
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
What is the value of the Size variable (probably it's placed into the Variables.ini file)?bernardovs23 wrote:Here it is
-
- Posts: 28
- Joined: April 6th, 2017, 2:43 pm
Re: Album cover animations: Help
100balala wrote:What is the value of the Size variable (probably it's placed into the Variables.ini file)?
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
As I said, I don't use Spotify, so I had to switch to the NowPlaying plugin, which can return almost the same information as the SpotifyPlugin, just for other players. With this plugin I don't have errors at all, the skin is working well with the Rotator meter. However I'd like to mention one problem I see on your code: at least the NowPlaying plugin doesn't return the cover always at the same size. The size of the returned cover is changing, so you can't use the same value for the Size variable. To determine the size of the returned cover I think you should use the ImageSize plugin, made exactly for such things (to determine the width and height of an image).
If you are interested, please let me know to describe you how to do this.
If you are interested, please let me know to describe you how to do this.
-
- Posts: 28
- Joined: April 6th, 2017, 2:43 pm
Re: Album cover animations: Help
I am insterestedbalala wrote:As I said, I don't use Spotify, so I had to switch to the NowPlaying plugin, which can return almost the same information as the SpotifyPlugin, just for other players. With this plugin I don't have errors at all, the skin is working well with the Rotator meter. However I'd like to mention one problem I see on your code: at least the NowPlaying plugin doesn't return the cover always at the same size. The size of the returned cover is changing, so you can't use the same value for the Size variable. To determine the size of the returned cover I think you should use the ImageSize plugin, made exactly for such things (to determine the width and height of an image).
If you are interested, please let me know to describe you how to do this.
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
Ok, then first you should install the ImageSize plugin, available here: https://forum.rainmeter.net/viewtopic.php?p=101884#p101884bernardovs23 wrote:I am insterested
The easiest way to install the plugin would be to download and run the ImageSize_3.0.rmskin skin installer (from the above link). The installer, beside the skin, will install the appropriate version of the plugin (the 32 or the 64 bit version), to the right folder. Then you can remove the newly installed skin, if you don't need it, however you could take a look to see a very good example how the plugin can (and must) be used.
Now, if you have the plugin installed, add the following two measures to your code:
Code: Select all
[MeasureCoverWidth]
Measure=Plugin
Plugin=ImageSize
ImageName=[Measure.AlbumArt]
Dimension=Width
DynamicVariables=1
Group=ImageSize
[MeasureCoverHeight]
Measure=Plugin
Plugin=ImageSize
ImageName=[Measure.AlbumArt]
Dimension=Height
DynamicVariables=1
Group=ImageSize
The [MeasureCoverWidth] and [MeasureCoverHeight] measures will return the width and the height of the cover, returned by the [Measure.AlbumArt] measure.
Now you can use these values into the rotator meter, to set the center of rotation:
Code: Select all
[Meter.AlbumArt]
Meter=Rotator
MeasureName=Measure.AlbumArt.Rotate
ImageName=[Measure.AlbumArt]
W=[MeasureCoverWidth]
H=[MeasureCoverHeight]
OffsetX=([MeasureCoverWidth]/2)
OffsetY=([MeasureCoverHeight]/2)
DynamicVariables=1
LeftMouseUpAction=[!ToggleMeasure Measure.AlbumArt.Rotate]
For this, replace the existing [Meter.AlbumArt] rotator meter, with the following image meter:
Code: Select all
[Meter.AlbumArt]
Meter=Image
MeasureName=Measure.AlbumArt
X=0
Y=0
W=200
H=100
PreserveAspectRatio=1
TransformationMatrix=(Cos(Rad([Measure.AlbumArt.Rotate])));(-Sin(Rad([Measure.AlbumArt.Rotate])));(Sin(Rad([Measure.AlbumArt.Rotate])));(Cos(Rad([Measure.AlbumArt.Rotate])));(([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)-((([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)*Cos(Rad([Measure.AlbumArt.Rotate]))))-((([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)*Sin(Rad([Measure.AlbumArt.Rotate])))));(([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)+((([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)*Sin(Rad([Measure.AlbumArt.Rotate]))))-((([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)*Cos(Rad([Measure.AlbumArt.Rotate])))))
DynamicVariables=1
LeftMouseUpAction=[!ToggleMeasure Measure.AlbumArt.Rotate]
- The W and H options of the meter will let you to resize the image to any size. In plus, all covers will be shown at the same size (in this case 200x200 pixels, but obviously you can modify the values of these options), no matter which is the size of the cover.
- You can move the meter (through its X and Y options). The image will rotate always around its own center.
- I know that the posted TransformationMatrix option is complicated enough and maybe at first look, you won't understand nothing, but the math behind it, isn't so complicated as it looks at first look. To understand it, you should read first the following description: https://docs.rainmeter.net/tips/transformation-matrix-guide/ (focus on the "Transformations" and the next "What the heck is Rainmeter doing?!" sections).
- In the [Rainmeter] section of your last code, you've used an Update=1 option. You have to know that the lowest possible value for Update is 16, using a smaller one, will make the skin to work as with Update=16. Read the second paragraph here, then modify that value.
-
- Posts: 2
- Joined: November 12th, 2019, 2:53 pm
Re: Album cover animations: Help
Good afternoon, I am very new, just two days and this transformationmatrix does exactly what I want except a circumstance:
rotating counterclockwise and I want it to turn clockwise. "switch around values b and c and recalculate tx and ty" I get lost. Could you help me turn right?
Thank you. Regards.
rotating counterclockwise and I want it to turn clockwise. "switch around values b and c and recalculate tx and ty" I get lost. Could you help me turn right?
Thank you. Regards.
Code: Select all
PreserveAspectRatio=1
TransformationMatrix=(Cos(Rad([Measure.AlbumArt.Rotate])));(-Sin(Rad([Measure.AlbumArt.Rotate])));(Sin(Rad([Measure.AlbumArt.Rotate])));(Cos(Rad([Measure.AlbumArt.Rotate])));(([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)-((([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)*Cos(Rad([Measure.AlbumArt.Rotate]))))-((([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)*Sin(Rad([Measure.AlbumArt.Rotate])))));(([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)+((([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)*Sin(Rad([Measure.AlbumArt.Rotate]))))-((([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)*Cos(Rad([Measure.AlbumArt.Rotate])))))
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
For such a simple thing, you don't have to complicate things with all those variables (b, c, tx and ty). Just have to replace the [Measure.AlbumArt.Rotate] section variable into the TransformationMatrix option with -[Measure.AlbumArt.Rotate]:
Code: Select all
TransformationMatrix=(Cos(Rad(-[Measure.AlbumArt.Rotate])));(-Sin(Rad(-[Measure.AlbumArt.Rotate])));(Sin(Rad(-[Measure.AlbumArt.Rotate])));(Cos(Rad(-[Measure.AlbumArt.Rotate])));(([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)-((([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)*Cos(Rad(-[Measure.AlbumArt.Rotate]))))-((([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)*Sin(Rad(-[Measure.AlbumArt.Rotate])))));(([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)+((([Meter.AlbumArt:X]+[Meter.AlbumArt:W]/2)*Sin(Rad(-[Measure.AlbumArt.Rotate]))))-((([Meter.AlbumArt:Y]+[Meter.AlbumArt:H]/2)*Cos(Rad(-[Measure.AlbumArt.Rotate])))))
-
- Posts: 2
- Joined: November 12th, 2019, 2:53 pm
Re: Album cover animations: Help
Thank you very much, I was totally lost with TX and TY.
It works very well.
Very thankful.
Regards.
It works very well.
Very thankful.
Regards.