I was inspired by the Algorithmist’s TRON Clock so for funzies over the weekend I wanted to make my own using Away3D. I find that I learn the most when I’m just playing around with something like this and exploring different ways to code or design.
Starting with the outermost ring – hand – you can see the month, date, hours, minutes, and seconds. If you watch the seconds hand closely you’ll see that it not only completes more of the arc each second but also moves closer to the minute hand. The distance along the z-axis is computed by percentage of that hands completeness. So on December 31st just before midnight the clock would be flat. And then when it ticks over to January 1st it will expand to it’s greatest depth.
You can mouse over the different rings – I call them hands in the code – and you should see a little label popup at the top of the ring. That’s using the Txt3D class that I created.
The mouse events don’t work all that great. I think it’s a problem with different layers at different depths and Away3D trying to calculate what the mouse is currently over. The Away3D mouse events work very well when it’s clear what the mouse is over. There is also some odd bug in the code that makes the month hand jumpy sometimes when you mouse over the clock. I’ve not been able to figure out why that happens.