forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


ClockSaverWin Screensaver
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Other Product Support/Announcements
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri May 08, 2009 5:52 pm    Post subject: ClockSaverWin Screensaver Reply with quote

ClockSaverWin

Description:
ClockSaverWin is a recreation of the "KClock" screensaver usually included in the K-Desktop Environment (KDE) on Linux/Unix systems. It is an analog clock screensaver with customizable colors. You can have the clock move around the screen, or simply just sit right in the middle of the screen.

Internet Explorer is required is because the actual clock face and movement itself uses Vector Markup Language (VML) and Internet Explorer is used for rendering.

Listing:
http://www.vdsworld.com/search.php?view_mode=fileinfo&file_id=504

Download:
http://www.vdsworld.com/download.php?id=504

* ClockSaverWin was originally programmed in VDS 5, but earlier this year I moved it over to VDS 6 and completed it in VDS 6.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Fri May 08, 2009 6:26 pm    Post subject: Reply with quote

love it.. great screen saver. Is it possible to see the code.
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat May 09, 2009 12:25 am    Post subject: Reply with quote

briguy wrote:
love it.. great screen saver. Is it possible to see the code.


Yeah, let me clean it up and I'll upload it sometime this weekend.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat May 09, 2009 6:34 am    Post subject: Reply with quote

There ya go... Eee, mind you, there's like absolutely no commenting at all in that stuff. Also, my style of coding may not be what you're used to. I'm a bit unorthodox I think. Anyway, have fun and I hope you can find something of use in there.

Info:
http://www.vdsworld.com/search.php?view_mode=fileinfo&file_id=505

Download:
http://www.vdsworld.com/download.php?id=505

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Thu May 14, 2009 8:12 pm    Post subject: Reply with quote

Garrett,

How would I speed up the secondhand to look like a rolex second hand smooth moving or say instead of 60 ticks maybe 240 per minute

I presume the below have something to do with it. Not sure how your math is working here.

secondsPointer.style.rotation = now.getSeconds() * 6;
LIST ADD,1, m01.style.rotation = 1 * 6;
LIST ADD,1, m02.style.rotation = 2 * 6;

etc

Also thanks for the source. Quite cool great job. I've learned alot from it already.
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu May 14, 2009 11:19 pm    Post subject: Reply with quote

Hmmmm...... Lemme go back and look at the code again. It's actually been a long time since I played with the VML code itself. I actually learned a lot on the VML myself doing this. The original example wasn't very complete at all and I had to add a lot of stuff to it.
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri May 15, 2009 12:16 am    Post subject: Reply with quote

My bad, not the VML, it's all in the JS.

and the line to look at, which I'm trying to figure out now is:

Code:
secondsPointer.style.rotation = now.getSeconds() * 6;


I'm trying to work in the getMilliseconds() to get the effect you want, but my arithmetic skills are lacking.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri May 15, 2009 1:16 am    Post subject: Reply with quote

Yeah... I can't figure out how to work in the milliseconds at all to get the effect you need. Sorry.
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri May 15, 2009 11:05 am    Post subject: Reply with quote

Garrett wrote:
Yeah... I can't figure out how to work in the milliseconds at all to get the effect you need. Sorry.

Don't be sorry. This recent round of posts made me have a look at this screensaver for the first time... and I like it! Especially with a rolex style second hand! Cool

Replace this line:
Code:
  LIST ADD,1,  secondsPointer.style.rotation = now.getSeconds() * 6;

With this:
Code:
  LIST ADD,1,  secondsPointer.style.rotation = now.getSeconds() * 6 + now.getMilliseconds() / 167;

_________________
cheers

Dave
Back to top
View user's profile Send private message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Fri May 15, 2009 1:20 pm    Post subject: Reply with quote

Ok.. I have to say, you GUYS ROCK!!!

but could you explain the code

LIST ADD,1, secondsPointer.style.rotation = now.getSeconds() * 6 + now.getMilliseconds() / 167;

what does the 167 do what is the math behind it?

Thanks again. I love this forum.
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri May 15, 2009 4:18 pm    Post subject: Reply with quote

Briguy, now that Dave seems to have figured that part out for you, I can give you at least one more tip to aid in your effect.

Change the timer which is likely currently

Code:
window.setInterval("updatePointers()", 100);


to

Code:
window.setInterval("updatePointers()", 50);


Or even set it to 10.. Well, ok, maybe not 10 as that will likely start pegging out the lower end cpu on some machines. But 50 will work for sure.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Fri May 15, 2009 4:44 pm    Post subject: Reply with quote

I changed Daves code a tad and seems to work slightly better. 6 * 166.67 = 1000.02 value vers 1002. The clock worked but had a slight adjustment every minute if you stare it. LOL.. you would think I have something better to do then stare at a clock.

Code:

 LIST ADD,1,  secondsPointer.style.rotation = now.getSeconds() * 6 + now.getMilliseconds() / 167;



Code:

  LIST ADD,1,  secondsPointer.style.rotation = now.getSeconds() * 6 + now.getMilliseconds() / 166.67;



Also with your change Garrett it works perfectly. I didn’t understand the math at first but now I do essentially 6 degree movment every second. Cool.

Thanks All!

[/code]
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sat May 16, 2009 9:46 am    Post subject: Reply with quote

briguy,

I've noticed that sometimes, the first time that the second hand gets to 1 second paste the 12 o'clock mark it jumps back about 1 second. Changing 167 to 166.67 or even 166.66666666666667 makes no difference. Sometimes it does it, and sometimes it doesn't. Confused


Garrett,

Is it possible to easily add a text brand name onto the clock face? Or better yet, a logo image?

OK, a little googling has revealed that v:text and v:image are both possible. Any pointers on where to start?

_________________
cheers

Dave
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat May 16, 2009 5:09 pm    Post subject: Reply with quote

I actually added text to it once when I was first experimenting, but ran into some problem doing that. But at the moment, I can't remember what the problem was. It's been some time now since I first started on this project and then it sat for a long time before I got back to it and finished it.

In the end, I didn't need any text on the clock to clone the KClock saver from KDE, so I never revisited testing with text on it.

If you do experiment, be sure to place the text below the Hour, Minute and Second arms.

Hit MSDN for the VML references. And remember, VML only works in MSIE, no other browser supports it.

I also found that when get down in dimensions of the clock, it begins to look bad, say under 100. I had some experiments that were 32x32 and 16x16, and could never get them to look nice no matter what sizes I used for the tick markers and arms.

And the reason I went with MSIE and VML is because it offered anti-aliasing, and the draw.dll for VDS does not.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat May 16, 2009 5:12 pm    Post subject: Reply with quote

Dave® wrote:
briguy,

I've noticed that sometimes, the first time that the second hand gets to 1 second paste the 12 o'clock mark it jumps back about 1 second. Changing 167 to 166.67 or even 166.66666666666667 makes no difference. Sometimes it does it, and sometimes it doesn't. Confused


I wonder if resetting the clock from our own code would resolve that. Meaning, when the seconds hit 59, reload the clock in the browser element. I'm guessing that might cause a bit of a flicker or undesired effect that breaks the smooth flow it.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Other Product Support/Announcements All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group