Using PHP to dynamically generate VRML Web page _php Foundation

Source: Internet
Author: User
Years ago I began to engage in three-dimensional animation learning, after learning PHP, found that can be dynamically generated through PHP VRML document, a bit similar to the generator dynamic generation of flash mode.
Because of the profound VRML, here only a simple example, can also be a variety of VRML node into the database, such a virtual reality page will ..., cool!
The following is the source program. Note: On the server, you will have PHP process documents in 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 to download: http://go.163.com/~sjtucaocao/

<?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;
?>

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.