I have been engaged in 3D animation many years ago. after learning php, I found that I can use PHP to dynamically generate the OpenGL document, which is a bit similar to the Generator to dynamically generate Flash. Due to the wide and profound knowledge of VRML, here is only a simple example. you can also store various types of VRML nodes into the database. such a web page of virtual reality will ......, Great! The following is the source program. Note: on the server, PHP should be allowed to process wrl-format documents. Otherwise, the consequence would be that I did not learn 3D animation many years ago, but I learned php later, it is found that you can use PHP to dynamically generate the VRML file, which is a bit similar to the Generator to dynamically generate Flash.
Due to the wide and profound knowledge of VRML, here is only a simple example. you can also store various types of VRML nodes into the database. such a web page of virtual reality will ......, Great!
The following is the source program. Note: on the server, PHP is required to process wrl-format documents. Otherwise, there will be no virtual reality. SOURCE program directly saved into wrl files, in the browser to install plug-ins, you can go to my another home page 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;
?>