| °¼º¿ø 2004-03-04, 10:29 pm |
| #VRML V2.0 utf8
Shape {
geometry DEF display Text {
string ""
}
appearance Appearance {}
}
DEF TS TimeSensor {
cycleInterval 0.01
loop TRUE
}
DEF Scr Script {
eventIn SFTime set_stop_watch
eventOut MFString stop_watch_changed
field SFInt32 first_hour 0
field SFInt32 second_hour 0
field SFInt32 first_min 0
field SFInt32 second_min 0
url["java script:
function initialize(){
stop_watch_changed[0]=first_hour+''+second_hour+':'+first_min+''+second_min;
}
function set_stop_watch(){
second_min++;
}
function eventsProcessed(){
if(second_min==10){
first_min++;
second_min=0;
if(first_min==6){
second_hour++;
first_min=0;
if(second_hour==10){
first_hour++;
second_hour=0;
}
}
}
stop_watch_changed[0]=first_hour+''+second_hour+':'+first_min+''+second_min;
}
"
]
}
ROUTE TS.cycleTime TO Scr.set_stop_watch
ROUTE Scr.stop_watch_changed TO display.string
"Mohammad Khan" <ug37mxk@cs.bham.ac.uk> wrote in message
news:c273su$314$1@soapbox.cs.bham.ac.uk...
> Hi
>
> can anyone point me towards some VRML code which allows me to dispplay the
> passage of time. Basically a counter which shows a clock ticking over.
> "00:00" and then "00:01" etc.. thanks in advance
>
>
> Mo.
>
>
|