Use PHP to dynamically generate a Web page Based on OpenGL

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, 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/

<? Php header ("Content-type: application/x-vrml"); $ txt = "# fig

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.