Home  >  Article  >  Backend Development  >  Use PHP to dynamically generate VRML web pages_PHP tutorial

Use PHP to dynamically generate VRML web pages_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:03:43751browse

I started studying 3D animation many years ago, and then I learned PHP and found that I could dynamically generate VRML documents through PHP, which is somewhat similar to how Generator dynamically generates Flash.
Due to the broad and profound nature of VRML, we only introduce a simple example here. Various VRML nodes can also be stored in the database. Such a virtual reality web page will be... cool!
The following is the source program. Note: On the server, you must let PHP process the wrl format document, otherwise the result will be no virtual reality. The source program is directly saved as a wrl file. To install the plug-in in the browser, you can download it from my other homepage: http://go.163.com/~sjtucaocao/


DEF leftBox Transform
{
translation -5 0 0
children
[
Shape
{
appearance Appearance
{
material Material {} 

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 >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/316178.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/316178.html

TechArticle

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn