Due to VRML Bachelor, only one simple example is introduced, and various VRML nodes can be stored in the database, and below is the source program. Note: On the server, you want to process the PHP to process the documentation in the WRL format, otherwise the consequence will be no virtual reality.
php header ("Content-Type: Application / X-VRML"); $ txt = "# VRML V2.0 UTF8
Def Leftbox Transform
{
Translation -5 0 0
Children
[
Shape
{
APPEARANCE APPEARANCE
{
Material Material
{
Diffusecolor 1 0 0
}
}
Geometry Box {}
}
DEF Spherechild Shape
{
APPEARANCE APPEARANCE
{
Material Material
{
Diffusecolor 1 0 1
}
}
Geometry Sphere
{
RADIUS 1.2
}
}
]
}
DEF Rightbox Transform
{
Translation 5 0 0
Children
[
Shape
{
APPEARANCE APPEARANCE
{
Material Material
{
Diffusecolor 0 0 1
}
}
Geometry Box {}
}
]
}
Def onoff transform
{
Translation 0 -1 0
Children
[
Shape
{
APPEARANCE APPEARANCE
{
Material Material
{
Diffusecolor 0 1 0
}
}
Geometry Box {}
}
DEF TS TOUCHSENSOR {}
]
}
Def S script
{
Eventin sfbool isactive
Eventout Mfnode Child
Field Mfnode TestNode Use SphereChild
URL
JavaScript:
Function isactive (Value)
{
IF (Value)
{
Child = TestNode;
}
}
"
}
Route Ts.IsActive to S.IsActive
Route S.Child to Leftbox.removeChildren
Route s.child to rightbox.addchildren "; Echo $ txt;
?>