Rotate a meter?

Help with creating, editing & fixing problems with skins

Rotate a meter?

I have an image that I want to rotate but I think I need it to be on a meter so that it can counter-rotate. I'm trying to make an Orrery, with the planets rotating around the Sun (I haven't found an example of that yet). So far if I do an image ROTATE, I can't then change the size or orientation of the image.

I'm very new, but have some scripting experience, I read the Docs, and searched the forum. I'm using W7 and this should be the current Rainmaker.

My whole code is a mess, but the relevant and nonworking portion is borrowed from the example of an analog clock in the docs:

Code: Select all

`[MeterSecondsHandball]Meter=ROTATORMeasureName=MeasureTimeX=10Y=10ImageName = #@#Images\Moonhalf.jpgW=10H=10PreserveAspectRatio=1AntiAlias=1StartAngle=4.7124RotationAngle=6.2832ValueRemainder=60`

Is it possible to rotate a meter? Can I go to sin/cos in the meter position? I read somewhere about TransformationMatrix but I don't think I have the math for that.

Re: Rotate a meter?

TransformationMatrix is very good in such things. It can be used, but its math is indeed not very easy.
Please post the whole code and the involved images, or even better pack the whole config you have so far and I'll try to help you with the appropriate TransformationMatrix option(s).

Re: Rotate a meter?

I will cut it down to the part I'm working on (it's got extraneous things all over) and post it soon.

Re: Rotate a meter?

OK, this is kind of embarrassing, I'm really new, like yesterday new. There's not much here but I've tried referencing the "MeterPlanet" inside the "MeterSecondsHandMoon" various ways and it doesn't even seem to see it. The image now spins on a corner, but I can't size it or get it to go around the "MeterSun". I can get the positions from Wolfram once a day, but right now I am just using the clock to see if I can get it to work.

Code: Select all

`[Rainmeter]Update=1000AccurateText=1[MeterSun]Meter=ShapeShape=Ellipse 50,50,50[MeterPlanet]Meter=ImageShape=Ellipse 175,175,5ImageName = #@#Images\Moonhalf.jpgH=10W=10[MeasureTime]Measure=Time[MeterSecondsHandMoon]Meter=ROTATORMeasureName=MeasureTimeX=10Y=10ImageName = #@#Images\Moonhalf.jpgW=10H=10PreserveAspectRatio=1AntiAlias=1StartAngle=4.7124RotationAngle=6.2832ValueRemainder=60[MeterSecondsHand]Meter=ROUNDLINEMeasureName=MeasureTimeX=0Y=0W=110H=116LineLength=52LineColor=247,220,129,255LineWidth=2AntiAlias=1StartAngle=4.7124RotationAngle=6.2832ValueRemainder=60`
Attachments

Re: Rotate a meter?

My plan (and the problem may be in my plan) was to place the planetary objects once a day with a 3:am call to Wolfram, then just rotate them all around the sky over the 24 hours. The divergence would not be enough to matter, even for the moon.

Re: Rotate a meter?

I'm not sure I understood and it's not clear at all to me what you mean by
baerdric wrote:referencing the "MeterPlanet" inside the "MeterSecondsHandMoon"

and also what would be the Wolfram.
However here is a first attempt:

Code: Select all

`[Rainmeter]Update=1000AccurateText=1[Variables]Radius=200MoonDiameter=25[MeterSun]Meter=ShapeShape=Ellipse 50,50,50X=300Y=200[MeterPlanet]Meter=ImageShape=Ellipse 175,175,5ImageName=#@#Images\Moonhalf.jpgH=10W=10[MeasureTime]Measure=TimeFormat=%#S[MeasureAngle]Measure=CalcFormula=( -1 * (( 2 * PI * MeasureTime ) / 60 ))[MeterSecondsHandMoon]Meter=ImageImageName=#@#Images\Moonhalf.jpgX=([MeterSun:X]+[MeterSun:W]/2-#Radius#*Cos(-[MeasureAngle])-([MeterSecondsHandMoon:W]/2))Y=([MeterSun:Y]+[MeterSun:H]/2-#Radius#*Sin(-[MeasureAngle])-([MeterSecondsHandMoon:H]/2))W=#MoonDiameter#H=#MoonDiameter#PreserveAspectRatio=1TransformationMatrix=(Cos([MeasureAngle]));(-Sin([MeasureAngle]));(Sin([MeasureAngle]));(Cos([MeasureAngle]));(([MeterSecondsHandMoon:X]+([MeterSecondsHandMoon:W]/2))-([MeterSecondsHandMoon:X]+([MeterSecondsHandMoon:W]/2))*Cos([MeasureAngle])-([MeterSecondsHandMoon:Y]+([MeterSecondsHandMoon:H]/2))*Sin([MeasureAngle]));(([MeterSecondsHandMoon:Y]+([MeterSecondsHandMoon:H]/2))+([MeterSecondsHandMoon:X]+([MeterSecondsHandMoon:W]/2))*Sin([MeasureAngle])-([MeterSecondsHandMoon:Y]+([MeterSecondsHandMoon:H]/2))*Cos([MeasureAngle]))DynamicVariables=1`

This code introduces two variables:
• Radius is the radius of the path of Moon, around the central object (which should be the Earth, because the Moon is rotating around the Earth, not around the Sun).
• MoonDiameter is the diameter of the image of the Moon. Here I also would say it would be a good idea to create a .png image from the moonhalf.jpg, to can remove the black background. You even can use some online tool for this, like http://www.ezimba.com/index-ln.html
Please let me know if this code has started to look like what you asked for.

Re: Rotate a meter?

YES, thank you and I think I understand how you did it. Thanks so much! Lots of adapting to do but it's at least moving properly!

Re: Rotate a meter?

Glad to help. If you have any further question, please let me know.

Re: Rotate a meter?

Still parsing through the matrix transformation. But you asked about Wolfram, they have an API that included a lot of astronomical data which I hope to chop up and use in my skin.
For Example. https://www.wolframalpha.com/input/?i=p ... se+and+set
When you have an API key you can get plain text in xml format. They do all kinds of data and computational stuff, plus they are trying to aggregate a full knowledge base for use via API. Quite a thing.

Re: Rotate a meter?

baerdric wrote:Still parsing through the matrix transformation. But you asked about Wolfram, they have an API that included a lot of astronomical data which I hope to chop up and use in my skin.
For Example. https://www.wolframalpha.com/input/?i=p ... se+and+set
When you have an API key you can get plain text in xml format. They do all kinds of data and computational stuff, plus they are trying to aggregate a full knowledge base for use via API. Quite a thing.

Probably useful. I'll take a deeper look, to see what they have.
However I'm a older fashion guy and I like to do some (astronomical) calculations locally, without downloading the results. Just two examples:
For sure an online tool can give much more information. But I also like the "offline" tools.