Falling Down: Alternating falling hours and minutes

Tutorial Falling Down: Alternating falling hours and minutes

First of all, of course, you can find the watch here:

[]

What happens is that the hours and minutes fall alternately from the sky every second and then disappear to the left or to the right.

First, of course, the individual images of the individual numbers were created (green for the hours and yellow for the minutes), something like this:
5rk

We need:

hour tens: 0,1
hour ones: 0,1,2,3,4,5,6,7,8,9
minute tens: 0,1,2,3,4,5*
minute ones: 0,1,2,3,4,5,6,7,8,9

The numbers, the back wall and the cover were created in the 3d program (Blender, 3dmax or similar possible).

We create an image for each digit in the Creator.

Let’s first deal with the falling of the numbers (movement from top to bottom).

The individual numbers should first fall from the sky within 0.200 seconds and then jump up and down a little bit (bounce) within 0.100 seconds.

For the rest of the second, the digits remain at the bottom and are thrown out to the right or left (but more on that later).

First we need to find the current milliseconds.

The tag #DWFSS# refers to the rotation angle for the second hand with the required 3 decimal places (0-359,993…).

If we divide this value by 6 (360/60 seconds/minute) we get the seconds, also with the milliseconds appended (e.g. 232,829/6 = 38,804).

Now all we need is the tag for the seconds per minute, this time without the milliseconds attached. With #Ds# we get exactly that.

Finally, we subtract the seconds without decimal places from the determined seconds with the appended milliseconds and get the current milliseconds.

The whole thing then looks like this (and always pay attention to the correct use of brackets!):

(((#DWFSS#)/6)-#Ds#) z.B. 38.804 sec – 38 = 0.804

All that effort just to figure out the milliseconds. But believe me, it’s worth it.

Actually there is still the tag #Dsm#. This should actually output the seconds plus the appended milliseconds. This would save us having to divide by 6 (see above). But the output value varies between 0.000 and 0.100 and is unfortunately not usable at the moment.

In the first 200 milliseconds we want to drop the digits in the Y direction from -100 to 160. At minus -100 the number is completely out of the picture, 160 is the “resting position”

Please remember that the Y axis runs from top to bottom.

At the top of the screen is 0. The center of the screen is at 160, 160 in the Y and X directions.

So we want to start from the Y coordinate -100 and fall to the Y coordinate 160 within 200 milliseconds, that’s a total of 260 pixels.

If we divide 260/0.2 we get 1300. We have to multiply this number by the milliseconds determined above. Then every millisecond the number should now move 0.001 x 1300 down 1.3 pixels. So in 200 milliseconds, then 200 x 1.3, and that’s exactly the 260 pixels needed.

We now have to enter -100 as the starting value because the digits should start from there (above).

The whole thing then looks like this:

*(-100+((((#DWFSS#)/6)-#Ds#))1300)

Now we need another condition because the whole thing should only take place from 0 to 0.200 (i.e. for 200 milliseconds).

The condition is therefore:
(((#DWFSS#)/6)-#Ds#)<=0.200

Now let’s put the whole thing together:
*(((#DWFSS#)/6)-#Ds#)<=0.200?(-100+((((#DWFSS#)/6)-#Ds#))1300)

From 0.200 to 0.250 it goes up (from Y= 160 to Y=140) and from 0.250 to 0.3000 it goes down again (from Y= 140 back to Y=160).

Going up takes 0.05 seconds for 20 pixels, so 20/0.05 = 400, the same way going down.

Since the milliseconds at the start of the climb are 0.200, we have to subtract them again in the formula.

Up:
(((#DWFSS#)/6)-#Ds#)>0.200&&(((#DWFSS#)/6)-#Ds#)<=0.250?(160-((((#DWFSS#)/6)-#Ds#)-0.2)*400)

The two conditions (from > 0.2 to <= 0.250) are linked with the & character.

It goes down in the same way as up, only in the opposite direction (i.e. falling) and now with a starting value of 0.250.

(((#DWFSS#)/6)-#Ds#)>0.250&&(((#DWFSS#)/6)-#Ds#)<0.30?(140+((((#DWFSS#)/6)-#Ds#)-0.25)*400)

Now we put the 3 areas together (each enclosed with $ signs). At the end there is another value if no condition is met (now >= 0.300 remains).

And this value is the rest position (Y = 160 from >= 0.300 to < 100, as the rest)

When put together the whole thing looks like this:

$(((#DWFSS#)/6)-#Ds#)<=0.200?(-100+((((#DWFSS#)/6)-#Ds#))*1300):$$(((#DWFSS#)/6)-#Ds#)>0.200&&(((#DWFSS#)/6)-#Ds#)<=0.25?(160-((((#DWFSS#)/6)-#Ds#)-0.2)*400):$$(((#DWFSS#)/6)-#Ds#)>0.250&&(((#DWFSS#)/6)-#Ds#)<0.30?(140+((((#DWFSS#)/6)-#Ds#)-0.25)*400):160$

In the next step, the left digits (tens) should always be pulled to the left and the right digits should be pulled to the right. And this from 0.900 to 1.

The whole thing works in the same way as falling on the Y axis, only for the X position.

The finished formulas for the X positions (to the left), tens:

$(((#DWFSS#)/6)-#Ds#)>=0.900?(160-(((((#DWFSS#)/6)-#Ds#)-0.800))*700):160$

And the X position (to the right), one:

$(((#DWFSS#)/6)-#Ds#)>=0.900?(160+(((((#DWFSS#)/6)-#Ds#)-0.800))*700):160$

All digits now fall down from 0 to 0.3, and then are pulled right/out from 0.9 to 1.

In the next step we have to ensure that only the current numbers are displayed. For this we use the Width and Height fields.

hour tens:
$#DhZA#=0?320:0$

hour ones:
$#DhZB#=0?320:0$

minute tens:
$(floor(#Dm#/10))=0?320:0$

minute ones:
$(#Dm#-((floor(#Dm#/10))*10))=0?320:0$

The 0 must of course be adjusted for the individual numbers.

With this formality, the size outside of the valid digit is set to 0, so it is no longer visible.

The last thing we have to do is ensure that the hours and minutes are displayed alternately. For this we use the opacity.

hours:
$(#Ds#%2)=0?0:100$

minutes:
$(#Ds#%2)=1?0:100$

The modulo operator is used here in conjunction with the second. So alternately, with non-round seconds the hours are shown and with round seconds the minutes are shown.

Well, that’s it. You’ll get the rest together yourself. The tutorial from jmorga106 helped me a lot

https://community.facer.io/t/tutorial-digital-time-separate-images-for-each-number-no-font/24212

Thank you again for that.

I hope it wasn’t too long and have fun!

Greetings from Saxony

Cohan Weggs

10 Likes

Great stuff! I stumbled across your watch face and thought: Cool! How did he do that?
So, going to have to study this when I am a spare moment.

Just a tipp: use back ticks ` for the code, sometimes operands do not show properly.

Oh! and welcome to this community!

3 Likes

Welcome to the community - it’s the best one around.
Thanks for a great tutorial- i and many others will appreciate all the time and effort you put into it.

4 Likes

Great Stuff . A lot of work goes into something like that . A comprehensive Tutorial is Gold for the Communiy . As Tom Mentioned If is good to Format protect your Formulas . Sorry I can not look at the Face right now it is Bed time and the Lights are out . I hope your Face is Inspectable . Thank you and Welcome .

3 Likes

Cool!

1

3 Likes

It would be even nicer if you are willing to open it for inspection, it’s easier to learn.

3 Likes

Fantastic tutorial. Thanks for the detail, and a great face.
This could work just as well with a decent font, though the positioning would be much trickier as fonts don’t always fit into their nice size area as well as an image.
Also not as pretty or stunning but could be a leaner alternative with effort.

Fantastic work all round.

2 Likes

@cohanweggs

Love what you did. I know how much effort is needed and ambition, the willing to share. Curious what will be your next target.

Happy face making.

BC

3 Likes

Brother Christian

Okay. Let us look at the formula in Tela 2 in the OPACITY field. Tela 2 is variable as OPACITY. Tela 1 is stable at 100. We lay the variable element above the fixed one. Like now is the case.

This is the formula now

((sin(#DWE#*.5)*80)+20)
__

What i underlined is the variable coefficient that changes SPEED. Now it is .5
You could try 1, so then it changes the OPACITY of this element quicker.

So bigger numbers, for quicker. Smaller number for slower.

With 1 you have then
((sin(#DWE#*1)*80)+20)

You know that opacity can be maximum 100. So here we have 80 and 20. Why are they separated in this formula. Because we want 20 as minimum, in this case, we do not want to go beyond 20 for this element as opacity. On the 80, we let it grow from 1 to 80 with the time factor (#DWE#).

The #DWE#, is the time factor. Many elements use formulas with somehow a TIME factor in it. Like #DWE# (after awakening your watch, face) or #Ds# or …

You could also do
((sin(#DWE#*1)*100)+0)

We can play here like a little god with numbers and influence what is happening, be it on a face :laughing:

Try it out, and see what you like.

Hugs
Patrick

2 Likes

The two elements, the BARRA 2 and 1 need also a adaption, because we change up the speed. We adapt them later, after you have choosing how to change the speed.

2 Likes

I replied in the other one!!!

1 Like