Use PHP to dynamically generate a virtual reality Web Page

Source: Internet
Author: User
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, we only provide a simple example here. we can also store various types of VRML nodes into the database. this kind of virtual reality network SyntaxHighlight has been engaged in 3D animation learning many years ago, after learning about PHP, we found that we can use PHP to dynamically generate the VRML file, which is a bit similar to how Generator dynamically generates 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;
?>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.