Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Davide Carpi  
#1 Posted : 09 July 2013 17:24:35(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,185
Man
Italy
Location: Italy

Was thanked: 1103 time(s) in 724 post(s)
A simple animation Good


Best Regards,

Davide
File Attachment(s):
AnalogClock.sm (23kb) downloaded 207 time(s).
AnalogClock_viewer.7z (356kb) downloaded 123 time(s).
Davide Carpi attached the following image(s):
clock.gif
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 4 users thanked Davide Carpi for this useful post.
on 09/07/2013(UTC),  on 09/07/2013(UTC),  on 10/07/2013(UTC),  on 11/07/2013(UTC)
Offline Ber7  
#2 Posted : 09 July 2013 23:51:49(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 328
Man
Israel
Location: Beer-Sheva

Was thanked: 425 time(s) in 230 post(s)
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.
File Attachment(s):
AnalogClock1.sm (23kb) downloaded 95 time(s).
thanks 2 users thanked Ber7 for this useful post.
on 10/07/2013(UTC),  on 10/07/2013(UTC)
Offline Davide Carpi  
#3 Posted : 10 July 2013 00:20:04(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,185
Man
Italy
Location: Italy

Was thanked: 1103 time(s) in 724 post(s)
Thank you ber,

this make the script faster and easier to read Friends


Best regards,

Davide


P.S. worksheet updated Foto
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline Ber7  
#4 Posted : 11 July 2013 12:37:01(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 328
Man
Israel
Location: Beer-Sheva

Was thanked: 425 time(s) in 230 post(s)
Davide,if your program to change the settings a bit, we get
"real" analog clock (all the arrows are moving continuously).
Best Regards,
Ber7

File Attachment(s):
AnalogClock2.sm (22kb) downloaded 135 time(s).
thanks 2 users thanked Ber7 for this useful post.
on 11/07/2013(UTC),  on 11/07/2013(UTC)
Offline Davide Carpi  
#5 Posted : 11 July 2013 15:49:18(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,185
Man
Italy
Location: Italy

Was thanked: 1103 time(s) in 724 post(s)
I see, wonderful Good
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Online Jean Giraud  
#6 Posted : 16 July 2019 06:08:53(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,794
Canada

Was thanked: 693 time(s) in 541 post(s)
Originally Posted by: Ber7 Go to Quoted Post
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]

Offline oscampo  
#7 Posted : 18 July 2019 20:24:18(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 128
Man
Location: Cali, Colombia

Was thanked: 41 time(s) in 29 post(s)
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 Razonar Offline ):
Annoying "purple line" eliminated. Path for sound files fixed. More realistic movement of hands clock.


Analog Clock Real Time.PNG
MyClock2.sm (39kb) downloaded 14 time(s).
click_low.wav (172kb) downloaded 22 time(s).
alarm.wav (892kb) downloaded 19 time(s).

Edited by user 20 July 2019 00:24:52(UTC)  | Reason: Annoying "purple line" eliminated. Path for sound files fixed. More realistic movement of

thanks 2 users thanked oscampo for this useful post.
on 18/07/2019(UTC),  on 19/07/2019(UTC)
Offline Razonar  
#8 Posted : 19 July 2019 08:25:06(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 381
Uruguay

Was thanked: 191 time(s) in 116 post(s)
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 2 users thanked Razonar for this useful post.
on 19/07/2019(UTC),  on 19/07/2019(UTC)
Offline oscampo  
#9 Posted : 20 July 2019 00:15:08(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 128
Man
Location: Cali, Colombia

Was thanked: 41 time(s) in 29 post(s)
Originally Posted by: Razonar Go to Quoted Post
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 Clap 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.

Edited by user 20 July 2019 00:26:23(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.