It is currently April 28th, 2024, 10:21 am

Rotator slightly off

Report bugs with the Rainmeter application and suggest features.
Alex Becherer

Rotator slightly off

Post by Alex Becherer »

Untitled-2.png
these are two analog clock skins.
the left is done with Rotator meters while the right is done with Image meters with TranformationMatrix set.

if you look close at the center of the skin you'll see a little 6x6 (plus a little shadow) round knob on top that is a simple Image meter that does not get modified.

the hour hand at the center is an 8x8 square. this is off in the skin with the Rotator meters.

could it be that the Rotator meter is using a rounded value of PI?


(the shadows in the right skin have been fixed in the meantime, but that it offtopic anyways)
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Rotator slightly off

Post by Kaelri »

Sorry, I'm not sure what you mean when you say the hour hand is "off." It's not clear just from this image what's going on. Could you post the skin itself, perhaps?
Alex Becherer

Re: Rotator slightly off

Post by Alex Becherer »

it is hardly visible, just a minor distraction.
it' s mostly visible when the minute hand is at about 20 - 40 minutes.
i attached both skins.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Rotator slightly off

Post by Kaelri »

I'll be honest, I'm having trouble even seeing the difference. But from looking at the code, I can think of two things that might help:

1) Your Rotator meters are using real numbers for their StartAngle and Rotation angle options. It may help to change these to use formulas based on actual PI.

Code: Select all

StartAngle=(2*PI)
RotationAngle=(2*PI)
2) You can adjust the centering of the hour hand by changing the OffsetX and OffsetY options on [MeterZenHoursA] and [MeterZenHours]. These options do allow sub-pixel offsets, so you can try e.g. 194, 194.5, 194.75, etc. until it looks right to your eye.
Alex Becherer

Re: Rotator slightly off

Post by Alex Becherer »

Untitled-1.png
maybe an orange clock hand will make it clearer.

tip no. 1: doesn't make a difference (but thanks, it is definately better to use PI here)

tip no. 2: that doesn't help either. as the hour hand starts correctly at 0 minutes (see upper part of the screenshot) and gets progressively worse to 30 minutes (see lower part).
Last edited by Alex Becherer on August 15th, 2012, 11:23 pm, edited 1 time in total.
Alex Becherer

Re: Rotator slightly off

Post by Alex Becherer »

Untitled-2.png
bigger is better
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Rotator slightly off

Post by smurfier »

I'm pretty sure it's not because of how many digits are defined for Pi in the meter...

3.14159265358979323846
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Brian
Developer
Posts: 2688
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Rotator slightly off

Post by Brian »

I think what is happening is that Transformation Matrix is rotating the image at the point, while Rotator is rotating at the pixel (which is much wider than a point).

Add this meter to the end of each .ini to see what I mean:

Code: Select all

[CenterDot]
Meter=Image
SolidColor=255,0,0
X=195
Y=195
W=1
H=1
rotator.png
The left one is the Rotator meters, while the right one is the Transformation Matrix meters.

On the left, the 1x1 red pixel demonstrates the pixel that Rotator rotates around. Note how the Hour, Minute images are centered at this pixel.
On the right, the upper-left corner of the red pixel seems to be the center of the Hour and Minute images, not the pixel itself.

To fix this for the Rotator version, you can make "top.png" centered over the pixel (195, 195) instead of the point. Or you could make the image rotate like the other images.
For example:

Code: Select all

[Rainmeter]
Author=Alex Becherer
AppVersion=2003000
Update=1000
BackgroundMode=1

[Metadata]
Name=MILE Zen
Information=based on a design by MILE design project
License=Do-Not-Be-A-Dick-License
Version=1.0

[MeasureZenTime]
Measure=Time

[MeterZenBack]
Meter=IMAGE
X=0
Y=0
ImageName=back.png

[MeterZenHoursA]
MeasureName=MeasureZenTime
Meter=ROTATOR
X=1
Y=2
W=390
H=390
ImageName=hours-shadow.png
StartAngle=(2*PI)
RotationAngle=(2*PI)
ValueReminder=43200
OffsetX=195
OffsetY=195
ImageAlpha=100

[MeterZenHours]
MeasureName=MeasureZenTime
Meter=ROTATOR
X=0
Y=0
W=390
H=390
ImageName=hours.png
StartAngle=(2*PI)
RotationAngle=(2*PI)
ValueReminder=43200
OffsetX=195
OffsetY=195

[MeterZenMinutesS]
MeasureName=MeasureZenTime
Meter=ROTATOR
X=2
Y=3
W=390
H=390
ImageName=minutes-shadow.png
StartAngle=(2*PI)
RotationAngle=(2*PI)
ValueReminder=3600
OffsetX=195
OffsetY=195
ImageAlpha=100

[MeterZenMinutes]
MeasureName=MeasureZenTime
Meter=ROTATOR
X=0
Y=0
W=390
H=390
ImageName=minutes.png
StartAngle=(2*PI)
RotationAngle=(2*PI)
ValueReminder=3600
OffsetX=195
OffsetY=195

[MeterZenTop]
MeasureName=MeasureZenTime
Meter=ROTATOR
X=0
Y=0
W=390
H=390
ImageName=top.png
StartAngle=(2*PI)
RotationAngle=(2*PI)
ValueReminder=3600
OffsetX=195
OffsetY=195
-Brian
You do not have the required permissions to view the files attached to this post.
Alex Becherer

Re: Rotator slightly off

Post by Alex Becherer »

Brian wrote:I think what is happening is that Transformation Matrix is rotating the image at the point, while Rotator is rotating at the pixel (which is much wider than a point).
yes, it seems so.


Brian wrote:To fix this for the Rotator version, you can make "top.png" centered over the pixel (195, 195) instead of the point.
not going to help as this would just shift the problem from 30 minutes to 0 minutes.

Brian wrote: Or you could make the image rotate like the other images.
while this will not work for this particular skin, due to the bevel and shadow of top.png, this is a pretty clever idea. thanks.
Alex Becherer

Re: Rotator slightly off

Post by Alex Becherer »

may i suggest to change this for Rotator meters?

i think it should act the same way as Roundline meters do.