It is currently May 1st, 2024, 9:08 am

Variable Rotation Rate

Get help with creating, editing & fixing problems with skins
Klypto
Posts: 8
Joined: December 20th, 2010, 12:25 am

Variable Rotation Rate

Post by Klypto »

There are meters for bars and "curved bars" But what about variable rotation of an object?

My plan is to have an object (image or partial circle/curve) rotate faster as the CPU usage spikes and rotate slowly as it drops. To prevent abrupt or spontaneous changes in speed, I figured that the average CPU usage over a given time would give it a smoother acceleration/deceleration rates.

The thing is, I'm not an expert at creating calculations like that. I probably could, but I have no clue what I would need to do or if it's even possible.


How would I go about programing an object that does x rotations per minute, Only the x value is a dynamic variable?

Also, is it possible to have the average CPU usage within a period of 5-10 seconds measured and used as that variable?
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Variable Rotation Rate

Post by Alex2539 »

I would do something like this:

Code: Select all

[MeasureSpinner]
Measure=Calc
Formula=(MeasureSpinner + MeasureCPU/10)%100
MinValue=0
MaxValue=100
Then if MeasureCPU has AverageSize set to something decent, it should speed up and slow down relatively smoothly. You can tweak the numbers there to suit your needs.
ImageImageImageImage
Klypto
Posts: 8
Joined: December 20th, 2010, 12:25 am

Re: Variable Rotation Rate

Post by Klypto »

Yay! it works.

Thank you



Just to be sure, is this the most efficient way to have it coded without sacrificing the visual "smoothness" of the rotation effect?
[MeasureCPU]
Measure=CPU
AverageSize=100

[MeterUnder1]
MeasureName=MeasureSpinner
Meter=ROTATOR
X=0
Y=0
W=218
H=218
ImageName=3.png
StartAngle=6.2832
RotationAngle=6.2832
OffsetX=91
OffsetY=90


[MeasureSpinner]
Measure=Calc
Formula=(MeasureSpinner + MeasureCPU/10)%100
MinValue=0
MaxValue=100