Years ago I began to engage in three-dimensional animation learning, after learning PHP, found that can be dynamically generated by PHP VRML documents, a bit similar to the generator dynamic generation of flash mode.
Because of the broad and profound VRML, here only a simple example, you can also put a variety of VRML nodes into the database, such a virtual reality Web page will ..., cool!
The following is the source program. Note: On the server, you will have PHP handle documents in the WRL format, otherwise the consequences will be no virtual reality. Source program directly into the WRL file, in the browser to install plug-ins, you can go to my other homepage download: http://go.163.com/~sjtucaocao/
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;
?>
http://www.bkjia.com/PHPjc/316801.html www.bkjia.com true http://www.bkjia.com/PHPjc/316801.html techarticle years ago I began to engage in three-dimensional animation learning, after learning PHP, found that can be dynamically generated by PHP VRML documents, a bit similar to the generator dynamic generation of flash mode. As a result of ...