Generate virtual reality VRML web pages with PHP

zhaozj2021-02-08  218

Due to VRML Bachelor, only one simple example is introduced, and various VRML nodes can be stored in the database, and below is the source program. Note: On the server, you want to process the PHP to process the documentation in the WRL format, otherwise the consequence will be no virtual reality.

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;

?>

转载请注明原文地址:https://www.9cbs.com/read-2967.html

New Post(0)