Analog Clock

Analog Clock - A simple animation - Messages

#1 Posted: 7/9/2013 10:24:35 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

A simple animation


Best Regards,

Davide
AnalogClock_viewer.7z (355 KiB) downloaded 187 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
4 users liked this post
ioan92 7/9/2013 11:21:00 AM, Вячеслав Мезенцев 7/11/2013 1:12:00 PM, Andrey Ivashov 7/10/2013 8:27:00 AM, Fridel Selitsky 7/9/2013 2:27:00 PM
#2 Posted: 7/9/2013 4:51:49 PM
Fridel Selitsky

Fridel Selitsky

520 likes in 451 posts.

Group: User

Beautiful animation: To reduce the computation time can be operators "for", which do not depend on time, move out of the function cloc (s).
Best Regards,Ber7.

AnalogClock1.sm (22 KiB) downloaded 162 time(s).
2 users liked this post
Davide Carpi 7/9/2013 5:15:00 PM, Andrey Ivashov 7/10/2013 8:27:00 AM
#3 Posted: 7/9/2013 5:20:04 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Thank you ber,

this make the script faster and easier to read


Best regards,

Davide


P.S. worksheet updated
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Posted: 7/11/2013 5:37:01 AM
Fridel Selitsky

Fridel Selitsky

520 likes in 451 posts.

Group: User

Davide,if your program to change the settings a bit, we get
"real" analog clock (all the arrows are moving continuously).
Best Regards,
Ber7


AnalogClock2.sm (21 KiB) downloaded 205 time(s).
2 users liked this post
Вячеслав Мезенцев 7/11/2013 1:12:00 PM, Davide Carpi 7/11/2013 8:45:00 AM
#5 Posted: 7/11/2013 8:49:18 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

I see, wonderful
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#6 Posted: 7/16/2019 12:08:53 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Beautiful animation: To reduce the computation time can be operators "for", which do not depend on time, move out of the function cloc (s).
Best Regards,Ber7.


Glorious old vintage, before I joined Smath.
More elegant needles in there ... needs be animated

Rolex.PNG

attach]31143[/attach]

#7 Posted: 7/18/2019 2:24:18 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Cheers to all!
This is my 5 cents to this thread. I only took some pieces of code from here and there, a little bit of make up, and.. voilá: my version of analog clock that works on "real" time

Updated 19jul2019 (Special thanks to [USERLINK]Razonar[/USERLINK]):
Annoying "purple line" eliminated. Path for sound files fixed. More realistic movement of hands clock.


Analog Clock Real Time.PNG
MyClock2.sm (38 KiB) downloaded 81 time(s).
click_low.wav (171 KiB) downloaded 79 time(s).
alarm.wav (891 KiB) downloaded 73 time(s).
2 users liked this post
frapuano 7/18/2019 2:53:00 PM, Alvaro Diaz Falconi 7/19/2019 2:04:00 AM
#8 Posted: 7/19/2019 2:25:06 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Hola Oscar. Very nice effects.

You can improve it multiply Play() by 1000 or something else but big. This avoid the horizontal purple line in the clock.

Also you define the location of the files as "D:\sound.wav". Using 1000*Play("sound.wav" ) searches sound in the same directory of the SMath file.

Finally notice that your blue hours hand jumps between hours, but not follow the actual movement of an hours hand clock. You need to take 1/2-1/6*el(NOW,1)-el(NOW,2)/600 as the arguments for sin, cos functions for place it between exact hours considering the minutes too.

Best regards.

Alvaro.
2 users liked this post
frapuano 7/19/2019 5:23:00 AM, Oscar Campo 7/19/2019 5:39:00 PM
#9 Posted: 7/19/2019 6:15:08 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Wrote

Hola Oscar. Very nice effects.

You can improve it multiply Play() by 1000 or something else but big. This avoid the horizontal purple line in the clock.

Also you define the location of the files as "D:\sound.wav". Using 1000*Play("sound.wav" ) searches sound in the same directory of the SMath file.

Finally notice that your blue hours hand jumps between hours, but not follow the actual movement of an hours hand clock. You need to take 1/2-1/6*el(NOW,1)-el(NOW,2)/600 as the arguments for sin, cos functions for place it between exact hours considering the minutes too.

Best regards.

Alvaro.



Thanks for your suggestions Also I considering the seconds in the movement of the minutes hand for a more realistic appearance.
I've updated the file and I uploaded the new one, you can check it here.
  • New Posts New Posts
  • No New Posts No New Posts