Inside: SereneScreen Fan Forum

Inside: SereneScreen Fan Forum (https://www.feldoncentral.com/forums/index.php)
-   Marine Aquarium 3 for Windows (https://www.feldoncentral.com/forums/forumdisplay.php?f=46)
-   -   Marine Aquarium 3 Comments & Appreciation (https://www.feldoncentral.com/forums/showthread.php?t=4382)

jleslie 02-01-2009 08:01 AM

You could get an idea by looking around and comparing a quartz clock/watch with a non quartz one?

philosopher 02-01-2009 08:28 AM

Jim,

While I truly appreciate your offer of giving beta testers a free keycode, I just purchased the upgrade from V 2.6 to 3.0. $9.95 is such a small amount to pay for such a great work of art! Thank you for all your hard work.

In the comments area during purchase I sent a note about two things, but I thought I'd post them here too, so they don't get lost:

During the purchase I clicked to create a new account. It was unclear how to best return to the purchase cycle once the account had been created. I looked around for a while and finally just hit the back button a few times.

Also, using IE 7 (I use almost every browser out there since I'm a web developer myself but I happened to open IE 7 for this purchase) I immediately noticed that I got a pop-up warning about an unsecure object - http:// - being loaded on the secure - https:// - page. (This warning does not appear on firefox - it just ignores/refuses to load the object in question.)

Examining the files I was able to find an image's full path hard coded into the site's "main.js" file. That image is what is causing the warning:

var Pic1 = new Array()
Pic1[3] = '/images/titlebar/TitleBarA.jpg'
Pic1[0] = '/images/titlebar/TitleBarB.jpg'
Pic1[1] = '/images/titlebar/TitleBarC.jpg'
Pic1[2] = 'http://www.prolific.com/images/titlebar/TitleBarD.jpg'

If you let prolific know to just change the last image path listed here to be the same as the ones above it then IE users won't be told something on the page is unsecure.

Jim Sachs 02-01-2009 11:38 AM

Thanks, I'll pass it along to Prolific.

rps 02-01-2009 07:11 PM

Quote:

Originally Posted by Jim Sachs (Post 110206)
Regarding the use of .png files as clock faces - Yes, the clock is an offshoot of the Logo system, so I could eaily put the hands over any picture. I may make it an option. But first I have to make the digital clock and calendar.

Regarding the second-hand, you are the first one to say that. Everyone else who's commented thought that the smooth-sweeping hand was great. It sure would have been a LOT easier to just move it once per second. You just need to read the Seconds field of the system time structure, and place the hand accordingly. I had to figure out the math (not my strong point) to factor in the milliseconds since the last screen refresh. The smooth-sweep looks far more elegant to me because when I see the "stuttering" hands in other programs I think, "Well, sure, they just have 60 different pre-antialiased drawings of that hand. Anybody could do that".


What can I say? I just like the old clock from MA2.6 better! :)

However, since you've already done the hard part, it should be relatively easy to add a checkbox to the clock configuration tab, labeled "Smooth second hand movement" (or something like that). If it's checked, do what you're doing now; if it's not, then just reset milliseconds in the time to zero, before doing what you're doing now. Effectively, the second hand will be drawn in the same spot for 1000 milliseconds, before the "second" changes, and hand position is updated to a new spot. It should only take one line of code (plus the code to save and restore one more option) to make it work either way.

Quote:

Originally Posted by patscarr (Post 110219)
I'd like to see examples of both the stuttering and smooth sweeping in the aquarium so I could make an educated decision as to which one I like best.

MA2.6 has the stuttering second hand; MA3Beta9 has the smooth (or sweep) second hand.

~Ralph S.

rps 02-01-2009 08:01 PM

Quote:

Originally Posted by Jim Sachs (Post 110206)
I had to figure out the math (not my strong point) to factor in the milliseconds since the last screen refresh.

Why are you figuring milliseconds since the last screen refresh? The angle of the second hand (in degrees, with 0 deg = straight up [12 o'clock]) would be:

getSystemTime(systemTime)
numsecs = systemTime.wsecond;
if smoothSecondHand.checked then numSecs = numSecs + (systemTime.wMilliseconds / 1000)
angle = 6 * numsecs // 6 degrees per second

Now that you know the angle of the second hand, you can use normal trig functions to figure out exactly where the hand is supposed to be, at the current time. You don't need to figure out the elapsed time since the last refresh; you only need to know the current time.

Hope this helps, (and makes the clock code easier)

~Ralph S.

Jim Sachs 02-01-2009 08:13 PM

Normal trig functions......hahahahahahahahaha!

The analog clock code is already in and working, never to be revistited. Now I'm on to the digital clock.

rps 02-01-2009 08:44 PM

Actually, having thought about it, you don't really want to call trig functions on every refresh cycle, because they're time-consuming, and very expensive (in terms of clock cycles). If I were doing this, I would create an array [0..59] of coordinate positions, representing the positions of the end of the second hand at each whole second. (The other end of the second hand is in the center of the clock, and remains constant.) This table gets initialized on startup; once you've calculated the positions, they don't ever have to be recalculated. On any drawing cycle, the "current second" is determined by reading systemTime.wSecond. For a stuttering second hand, you simply look up "position[curSec]". For a sweep hand, you can calculate the position by reading the milliseconds, and calculating the difference in position between position[cursec] and position[curSec + 1]:

dx = (position[curSec + 1].x - position[cursec].x) * systemTime.wMilliseconds / 1000
position.x = position[curSec].x + dx;

Repeat these two statements for position.y.

This code is fairly simple, it can be done entirely using integer operation (which makes it very efficient) and it's very easy to skip over the millisecond adjustment to convert from a sweep hand to a ticking hand.

I hope you'll reconsider your decision to "never revisit the analog clock code" again.

~Ralph S.

Jim Sachs 02-01-2009 09:03 PM

Nope.

henemly 02-01-2009 09:24 PM

Everything is perfect now. Thanks.

Jim Sachs 02-01-2009 09:38 PM

You will have many choices.

rps 02-01-2009 10:08 PM

For what it's worth, I wrote a simple test program to show a moving second hand, including a checkbox to make it sweep or tick; it's "secondHand.exe" and can be downloaded from http://sickinger.net/download

The code for this has also been posted, it's "sh_main.pas". (Because I'm a pascal programmer.) The key code (that would be applicable to the MA3 clock) is less than 25 lines. (For initialization the lookup tables and drawing the second hand, with an option for sweep or ticking.)

~Ralph S.

Jim Sachs 02-01-2009 10:56 PM

It's REALLY time to move on to something else. This subject is a dead parrot.

Jim Sachs 02-01-2009 11:21 PM

philosopher - thanks for catching that HTML error. JimR has fixed it.

tifosi 02-02-2009 01:10 AM

hello Jim, nice work on the MA3 crystal clock. I'm glad to report there are no multimonitor issues so far. on the other hand, is there any intention to allow the aquarium to be switched to nighttime lighting?

I vaguely remember you mentioning it but i cant really find the post/thread.

Thumbs up for the good work. Keeping the other thumb around for the grand finale and unveiling!

Jim Sachs 02-02-2009 01:41 AM

No Grand Finale or unveiling. Improvements will continue until they nail down the lid on my coffin.

There are all kinds of multimonitor issues, mostly having to do with users setting the monitors to different resolutions.

The user will eventually have much greater control of the background colors. The foreground "lighting" is more problematic, since MA3 uses Shaders now instead of the Direct3D lighting model. I'm working on it, though.

iMark 02-02-2009 08:42 AM

at this point, I almost wish I hadn't heard of the new version until it had progressed, or perhaps I should quit checking the forums.....it seems that everything but the fish and corals are important..music, clocks, multiple screens...yes, I understand it's all a process... yes, I understand that the bigger the group, the more problems get sorted out earlier....I'm just to the point where I'd like to see the gist of the aquarium move forward, and I'm in a bit of a crabby mood today, so forgive me for what sounds like complaining.....

cjmaddy 02-02-2009 09:02 AM

iMark, - I second that. - Hence my 'Cromwell' comment!

Jim Sachs 02-02-2009 10:48 AM

I know what you mean iMark. I was just sitting down to bring the clams to life (fun) when I got a wave of complaints that the clock/calendar wasn't in yet (not fun). There are even those who want me to go back and tear apart the clock code, even though it's working perfectly.

philosopher 02-02-2009 10:56 AM

You're Welcome
 
Jim,

You're welcome. I'm glad I could help out a little bit. I try to only comment when I think it may be useful and I can potentially provide some information that may be acted on.

Clams? It will be wonderful to see the clams moving! I know the squeaky wheel gets the grease. So here's a vote for letting you have some fun and getting the clams going instead of the clock/calendar additions!

Jim Sachs 02-02-2009 11:20 AM

I've got to finish up the clock/calendar first. At my age, I'll never remember where I was if I leave it half-finished.


All times are GMT -6. The time now is 11:00 AM.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.