Day/Night rotational

Hi @ll.

Has anybody found a good solution yet for a rotating picture in day/night mode? I would like to create something like the rotating Moonphase, for a visual sunrise/sunset.

I don´t mean something like: (180+#DWFHS#), this is far not precise enough.

Or is there any possibility to combine a rotation with sunrise and sunset Values, maybe for two hands?

Greetings,

Phantasico

@GAUSS,

Rotating image with each hour in the day (24-hour rotation tag)

Rotating same image but waiting for the sunrise and sunset hours to do so:

-John

Thanks John,

That´s the way i was thinking of… with two Twilight-Zones… But what Angle should they have?

Greetings,

Phantasico

Okay … already found a nice solution for the picture but now i have another problem…

I want to fade in and out a picture in slow speed, in a predefined hour-based timearea to simulate the colorchanges at sunrise and sunset.

To explain what type of effect i want to get: I have orange and a blue transparency-pics and i want to show them in a time between 6:00 to 8:00 and 19:30 to 21:30.

I think, Fade in and out could be separated by using a copy of the pictures, but how can i get the timearea and a slow fade in?

Thankful for any help!

Greetings, Phantasico

Hey @GAUSS,
Have a look at my Explorer Black above again which has inspection turned on. Look at the two layers MOON & SUN and SUN & MOON at the bottom of the layer stack. They are identical images, but one has the sun on top and the other has the moon on top. Each has rotation formulas to rotate either in the dawn hour (sunrise) or in the dust hour (sunset). Then each also has a fade-in/out transparency formula to do what you are describing (I think).

Also have a look at my cottage face below and check out the two layers “Daytime cottage” and “Night cottage”. The Daytime cottage just sits static all day but the Night cottage does that slow 1-hour fade-in at dust in front of the day cottage. Then a slow 1-hour fade-out at dawn revealing the day cottage again. Check the Night cottage transparency formula. Obviously there is no rotation here. Hopefully these formulas help.

Thanks,
John

1 Like

Wow!

John, you make my Day!

That´s great. The formula from the night-cottage is awesome.

It´s not exactly what i need, but very, very, very close …

Is it possible to split it in two parts? One Formula with Fade-in and Fade-out for Sunrise, one for Sunset)? I want to differ between left and right side.

I hate to bother you, but i am not very good in mathematics and programming. My talents are more in drafting, designing and painting.
I do my very best to learn and understand the scripts and the logic behind it but i know, i am lightyears away from your level.

Greeting,

Phantasico

hmmm @GAUSS I guess I’d have to see the use case. Can you post a link to your draft?

John

Thanks for your great help.

For sure i can post the draft.

For testing purposes i embeded your script, but only on the right orange Shiny-Layer…

There ar two pictures on each side, above the red/orange, beyond blue/purple…

Greetings,

Phantasico

@GAUSS,
ok man I see what you’re trying to do. The left & right images are see-through tinting that colors the sky blue-tint (left) or orange-tint (right).

I think the left (night) needs to be active over night. it fades in at sunset and fades out at sunrise:
$(#DH#+1)>=(#WSH#)&&(#DH#+1)<=(#WSH#)?((#Dm#) * (100/60)):$$(#DH#+1)<=(#WRH#)&&(#DH#+1)>=(#WRH#)?(100-(#Dm# * (100/60))):$$(#DH#+1)<(#WSH#)&&(#DH#+1)>(#WRH#)?0:100$

The right side (day) needs to be active during the daytime. It fades in at sunrise and fades out at sunset.
$(#DH#)>(#WRH#)&&(#DH#)<(#WSH#)?100:$$(#DH#)=(#WRH#)?((#Dm#) * (100/60)):$$(#DH#)=(#WSH#)?(100-(#Dm# * (100/60))):0$

Well, thats not exactly what i want to achieve.

The right side with the orange should slowly be visible one Hour before and two Hours after sunset.

The left side one hour before and two hours after sunrise. The other time of day shouldn´t have any light effects.

hmm… my formulas work in the sunset and sunrise hour. not an hour before or after. Let’s say today’s sunset is 6:38pm. I think you’re asking for visibility between 5:38pm and 7:38pm.

what I’m doing is looking at the hour. If the hour = 6 (or rather 18), run the fade (either out or in). I could change to say fade-in in the sunset hour (18) and fade out during the next hour (19). Same for morning. Just decide if you want the fades in the before hour or the after hour. Also I’m leaving for vacation in a bit. Wont be able to revisit until next week. Let me know if my idea still works?

-John

Yes. That´s exactly what i want … Fade in one hour in the sunset hour and fade out the hour after, and the same for the sunrise.

Oh. You are going for vacation. Thats cool. My next one is in May …

Thank you so much for helping me …

so real quick…

That’s only two states for each:

$(#DH#)=(#WRH#)?((#Dm#) * (100/60)):$$(#DH#)=(#WRH#+1)?(100-(#Dm# * (100/60))):0$ for day side
$(#DH#)=(#WSH#)?((#Dm#) * (100/60)):$$(#DH#)=(#WSH#+1)?(100-(#Dm# * (100/60))):0$ for night side

Check my sandbox dev-watch again:

Yes!

That does the trick!

The only thing i would like to test would be an expanded Version with 2 hours before and after sunrise/sunset (if this is possible). 1 hour is a little bit short. But it is not really necessary.

I never ever would have solved this problem alone.

For sure i will give you a special credit when i launch the watch.

Thanks a lot for your time and help and i wish you wonderful vacations!

All the best,

Phantasico

I’ve had good luck with If… Then… ElseIf… Then… ElseIf… as long as the conditions are straight equals operations. But compound conditions: If this AND that… then… elseif this AND that… I’ve had some real brain melts and in rare cases does it actually work. IF... Then... ELSEIF... Then... ELSEIF... etc

so… IF #DH# >= 2 hours before AND #DH# <= two hours after sunrise is a problem getting compound conditions to work. My formulas are a two-hour window in two pieces IF (#DH# = the sunrise hour THEN fadein) ELSEIF (#DH# = the hour after sunrise +1 THEN fadeout) ELSE (zero). Those are simple equals conditions.

You could spread it out to 3 hours and still stay in equals conditions.
IF (#DH# = 1 hour before sunrise hour -1 THEN fadein)
ELSEIF (#DH# = the actual sunrise hour THEN stay solid 100%)
ELSEIF (#DH# = the hour after sunrise +1 THEN fadeout)
ELSE (zero).

and playing with the +1, -1 on those #WRH# (sunrise) and #WSH# (sunset) pieces of the equations, you can slide the time window of these fades earlier or later.

Give it a shot, otherwise we’ll reconvene next week.

John