It is currently March 24th, 2019, 7:58 am

[Lots of Math] Moon Icon Rotation on a Sky Dial

Help with creating, editing & fixing problems with skins
Yincognito
Posts: 565
Joined: February 27th, 2015, 2:38 pm

Re: [Lots of Math] Moon Icon Rotation on a Sky Dial

Yincognito » January 8th, 2019, 12:24 am

So, raiguard, do you still have the problem, or you found a way of solving it? Because if you still have it, I would be tempted to share my opinion on the matter (I'm not scared of math, but I'm a bit lazy, LOL). For a start, my visual impression was confirmed by the measurements I've made in Photoshop: the great arc that you (apparently) move the moon shapes on is not perfect. Take a screenshot and measure with a rectangluar marquee tool the width of the space between the left of the arc and the green "dot" and compare it with the with of the space between the green dot and the right of the arc. For me, it yielded 248px for the former and 254px for the latter. Slight note: the size of the "center" of that arc should also be considered in a formula, if any.

Secondly, the fact that the skin width is modified when the moon starts approaching the 180 degree on the arc doesn't seem ok to me. There is most certainly an error in the formulas that make the movement of the "limb" (the illuminated part of the moon) incorrect. I would suggest slowing down the motion to better see what's going on (add 0.1 to the #moonDialAngle# variable and set Repeat Move, 16, 1800 in the [MeasureActionTimer] measure), or better, complete a Debug Dial Rotation to 180 degrees and just test Debug Limb Rotation in that point, until you fix it.

It's my first encounter with the Arc shapes in Rainmeter, so I don't know yet the specifics (help is available, but I must be "in the mood" to get that in my brain, LOL), but to me, there shouldn't be many exceptions / conditional operations in the formulas and things should be always calculated from the center (and not the margins) in elliptical formulas, because the center is always the stable reference. For example, instead of:

Code: Select all

moonArcStartX=(#dialStartX# - #dialObjectRadius#)
moonArcStartY=(#dialRadius# - #moonBorderThickness#)
I would write something like

Code: Select all

moonArcStartX=(#dialCenterX# - #dialRadius# - #dialObjectRadius#)
moonArcStartY=(#dialCenterY# + #dialObjectRadius# - #moonBorderThickness#)
where dialCenter would be the green dot (aka the center of the moon movement arc). Also, make you're considering every space you deal with (margins, borders, etc.). Last but not the least, when I tested the limb rotation at the 180 degrees point on the moon movement arc, I noticed that you restrict the limbs coordinates to a rectangle (it appears like bouncing from the rectangle's corners) - maybe an elliptical / circular restriction area would be more appropriate, since, after all, it should fit and be placed within a circle (delimited by the moon's border).