Clock Programming

This month's tech tip is a fun one! Have you ever wanted to make a clock that runs in CNW? A clock that keeps accurate time and can be set to display any time zone? I know I have always wanted one ever since version 3.1 came out with the special rotate building command. I've tried making a clock many times but I was never able to succeed in getting one to run correctly until recently when I was informed of a detail that I previously was missing about setting the clock.

For the "hands" of the clock, you will need to use some sort of pole object that has it's center (the intersection of the pink X, Y and Z axes you see when you right-click an object) at one end (preferably at the bottom) of the pole. Also, if you are building in CNW world (or any world that uses JunkYard world objects) there is a special set of ornate "hands" for the newer mantle clock object that can be used.

What's important when creating these objects is the starting positions of the "hands" prior to applying any rotate commands to them. The minute and second hands always point straight up to start with. For a traditional clock face this would mean the minute and second hands are pointing at 12 o'clock. The hour hand, however, is different. In order to have the hour hand synchronized with VRT time, it must have a starting position of -55 degrees (10 o'clock). If you know your own time zone's displacement from VRT, you can calculate what number on the clock face you need to rotate the hour hand in order to display your own local time. Keep in mind that this is not a 24-hour-style clock; we're talking your standard analog 1 to 12 o'clock face. Once you have the hands placed, here's what you need to paste into their Action boxes:

Hour Hand: create rotate 0 0 -0.00138888888 sync


Minute Hand: create rotate 0 0 -0.01666666668 sync


Second Hand: create rotate 0 0 -1 sync

By placing "sync" on the end of the command lines, you will enable the universe clock to fully control the hands so it will keep perfect time with a known, good time source signal. If you are using poles for your clock hands, it helps to color or texture the second hand differently than the hour and minute hands, I've found. If you followed these directions accurately, you'll have a cool VR clock running on RL time! lol As always, if you have any tech building questions, you can email them to:

ewasx@cybernetworlds.net

~Ewasx~