www.pudn.com > vrmlExample.rar > Create.wrl
#VRML V2.0 utf8
Viewpoint
{
position 0 0 15
orientation 0 0 1 0
fieldOfView 0.8
}
Background
{
skyColor [ 0 0 0.2,
0.1 0.1 0.8,
0.7 0.8 0.9
]
skyAngle [1 1.57]
groundColor [ 0.0 0.0 0.0,
0.5 0.4 0.3,
0.3 0.3 0.3
]
groundAngle [1 1.57]
}
DEF balls Transform
{
children
[
DEF touch TouchSensor{},
Shape{
appearance Appearance {
material DEF SphereColor Material { diffuseColor 1 0 0 }
}
geometry Sphere{}}
]
}
DEF add Script
{
url "Create.class"
eventIn SFTime touched
eventOut MFNode addSphere
}
ROUTE touch.touchTime TO add.touched
ROUTE add.addSphere TO balls.addChildren