Is it possible to write this so you don't have to force the angle to be the negative of itself?balala wrote:Yep, but this isn't a very big problem I think, because using the angles with a minus (as I wrote above) changes the rotation direction.
It is currently May 5th, 2024, 1:24 am
SolidColor, ClipString and Angle
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: SolidColor, ClipString and Angle
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: SolidColor, ClipString and Angle
Yike.. That guide is completely incomprehensible for the average user. My thinking was a simple guide to "rotating" a meter, which might be a bit easier to wrap your head around than a really long guide that fully explains the full power of "transforms".balala wrote: About the TransformationMatrix? If so, I'm not sure if it worth, because the Transformation Matrix Guide in the Tips & Tricks section is very good, I think.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: SolidColor, ClipString and Angle
Thanks balala!balala wrote:If you added this option, you also have to add an Angle variable to the [Variables] section. Obviously this variable represents the rotation angle, in degrees.Code: Select all
TransformationMatrix=(cos(Rad(#Angle#)));(-sin(Rad(#Angle#)));(sin(Rad(#Angle#)));(cos(Rad(#Angle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*cos(Rad(#Angle#))-([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*sin(Rad(#Angle#)));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*sin(Rad(#Angle#))-([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*cos(Rad(#Angle#)))
You should post this separately in "Community Tips" or even "'Featured Tips"!
I noticed this code in several other post you made, and used a variation of it to rotate my shape meters.
Because my meter had multiple defined shapes that were not combined, the Rotate and Scale actions of the Shape meter were giving me 'strange' results.
Your code made doing it a simple task!
Thanks for all of your help in applying the power of transformations!
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: SolidColor, ClipString and Angle
If Padding is applied, that's not true. A small offset appears, even if the meter is rotated around its top left corner. Without Padding there is no offset at all.jsmorley wrote:It's possible that the small difference in the X and Y offset that I see with Padding is due to the fact that you are rotating around the center of the meter, which may or may not be equally divisible by 2. If I rotate it around the top left of the meter, that issue seems to go away.
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: SolidColor, ClipString and Angle
I'm glad if you think so.eclectic-tech wrote:Thanks balala!
You should post this separately in "Community Tips" or even "'Featured Tips"!
I noticed this code in several other post you made, and used a variation of it to rotate my shape meters.
Because my meter had multiple defined shapes that were not combined, the Rotate and Scale actions of the Shape meter were giving me 'strange' results.
Your code made doing it a simple task!
Thanks for all of your help in applying the power of transformations!
Note that the formulas used in the TransformationMatrix option are not so complicated, as they seem to be at a first look. The only weirder things are the ([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2) and ([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2) parts of them. These are the coordinates of the anchor point and represents the center of the meter. Otherwise, I just applied what is described in the Transformation Matrix Guide tip.