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:
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