#VRML V2.0 utf8
PROTO Loader [
field SFString server "http://www.myserver.net/fetchwrl.php"
field SFString worldname "My%20World"
field SFBool isPHP TRUE
]{
DEF TS TimeSensor {
cycleInterval 1
stopTime -1
startTime 0
loop TRUE
enabled TRUE
}
DEF SC Script {
directOutput TRUE
mustEvaluate TRUE
field SFString server IS server
field SFString worldname IS worldname
field SFBool isPHP IS isPHP
eventIn SFTime starttime
field SFNode TS USE TS
field SFString browsername ""
field SFString newurl ""
field SFString parameter ""
url "vrmlscript:
function starttime() {
TS.enabled = false;
if (isPHP) { // The user has supplied a url to a php script.
browsername = Browser.getName();
newurl = server + '?name=' + browsername + '&world=' + worldname;
} else { // The user has supplied a url to a wrl file, not a php script.
newurl = server;
}
Browser.loadURL(newurl, parameter);
}
"
}
ROUTE TS.cycleTime TO SC.starttime
} |
#VRML V2.0 utf8
EXTERNPROTO Loader [
field SFString server
field SFString worldname
field SFBool isPHP
]["http://www.myserver.net/Proto_Loader.wrl"]
Loader {
url "http://www.myserver.net/fetchwrl.php"
worldname "Pointworlds" # This tells the PHP script what VRML to send.
isPHP TRUE
} |
// I have not written the code for this PHP script. Too busy at the // moment. Perhaps someone else might attempt to write it and test it. |
#VRML V2.0 utf8
EXTERNPROTO Loader [
field SFString server
field SFString worldname
field SFBool isPHP
]["http://www.myserver.net/loaderProto.wrl"]
Loader {
server "http://www.pointworlds.com/vrml/home/home.wrl"
isPHP FALSE
} |