3D Clock Applet


The 3D Clock applet is a simulation of a digital LED-display clock being rotated and twisted in space. It was inspired by a cool VGA-demo written by AXiS.

Tag syntax

<APPLET CODE="Clock3D.class" 
WIDTH="aNumber" HEIGHT="aNumber">- the width and height (in pixels) of the applet.
<PARAM NAME="FPS" VALUE="aNumber">- the number of frames to be painted per second. Default value: 13
<PARAM NAME="STYLE" VALUE="aNumber">- the style of the clock. Currently, this can be either 1 (ring-shaped clock) or 2 (twisted clock). Default value: 1
<PARAM NAME="12HOUR" VALUE="aNumber">- if set to 1, the clock will display 12-hour time (e.g. 10:25:33 PM instead of 22:25:33). Default value: 0
<PARAM NAME="PIXD" VALUE="aNumber">- the distance between two pixels. If STYLE=1, this is in vertical direction, for STYLE=2 in vertical and horizontal direction. Default value: 16
<PARAM NAME="PIXANGLE" VALUE="aNumber">- for STYLE=1, the angle between two horizontally adjascent pixels. For STYLE=2 the amount of "twist" between two pixels. Default value: 8
<PARAM NAME="RADIUS" VALUE="aNumber">- for STYLE=1, the radius of the circle on which the pixels are projected. Default value: 15
<PARAM NAME="A1" VALUE="aNumber">- a measurement for the distance between the monitor screen and the clock. The smaller this number, the closer (and larger) the clock appears. Default value: 5000
<PARAM NAME="ROTX" VALUE="aNumber">- the speed of rotation around the x-axis (in degrees/frame). Default value: 0
<PARAM NAME="ROTY" VALUE="aNumber">- the speed of rotation around the y-axis (in degrees/frame). Default value: 4
<PARAM NAME="ROTZ" VALUE="aNumber">- the speed of rotation around the z-axis (in degrees/frame). Default value: 0
<PARAM NAME="IROTX" VALUE="aNumber">- the inital angle of rotation around the x-axis. Default value: 0
<PARAM NAME="IROTY" VALUE="aNumber">- the inital angle of rotation around the y-axis. Default value: 0
<PARAM NAME="IROTZ" VALUE="aNumber">- the inital angle of rotation around the z-axis. Default value: 0
<PARAM NAME="COLOR" VALUE="aColor">- the color of the clock's pixels. Default value: #FF0000 (Red)
<PARAM NAME="BGCOLOR" VALUE="aColor">- the background color of the applet. Default value: #000000 (Black)
</APPLET> 

The colors in the COLOR and BGCOLOR parameters should be 24-bit RGB values. If the number is preceded by "0x" or "#", it will be interpreted as a hexadecimal value, if preceded by a "0", as an octal value. Otherwise the number will be regarded as decimal.

It's rather difficult to explain exactly what the different parameters do, so I would suggest you take the following example tag or one from the other example pages and then play around with the parameters.

Examples

As a first example, here's the tag used on this page:

<APPLET CODE="Clock3D.class" WIDTH=200 HEIGHT=200>
<PARAM NAME=fps VALUE=18>
<PARAM NAME=a1 VALUE=12500>
<PARAM NAME=pixd VALUE=29>
<PARAM NAME=pixangle VALUE=5>
<PARAM NAME=radius VALUE=26>
<PARAM NAME=roty VALUE=-4>
<PARAM NAME=rotx VALUE=0>
<PARAM NAME=rotz VALUE=0.401>
<PARAM NAME=irotx VALUE=0>
<PARAM NAME=iroty VALUE=0>
<PARAM NAME=irotz VALUE=0>
<PARAM NAME=style VALUE=1>
<PARAM NAME=color VALUE=#00FF66>
<PARAM NAME=bgcolor VALUE=#000000>
<PARAM NAME=12hour VALUE=0>
</APPLET>

Here are some more examples:

Use this applet!

The use of this applet on non-commercial homepages is free (commercial pages: mail me if you are interested). The only cost for using it is a link from your site to my page, and please send me an e-mail so that I know where my applet is being used.

Disclaimer: Bennet Uk shall not accept any responsibilies for damages resulting from the use of this applet and makes no warranty or representation, either express or implied, including but not limited to, any implied warranty of merchantability or fitness for a particular purpose.

Feedback

Any comments, suggestions, bug-reports and questions about this applet should be sent to me by e-mail. Your feedback is greatly appreciated!

Version History

Version 1.12 (26 June 1997)

Version 1.11 (11 March 1997)

Version 1.1 (6 March 1997)

Version 1.0 (10 November 1996)


To Bennet's Java Page

Last updated June 26, 1997
Please send feedback to bennet@dataway.ch