www.pudn.com > vrmlExample.rar > 7-3-4.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 ball Transform 
{ 
	children 
	[ 
		DEF Touch TouchSensor{} 
		Shape 
		{ 
			appearance Appearance 
			{ 
				material DEF Co Material 
				{  
					diffuseColor 1,0,0 
					emissiveColor 0.0 0.0 0.0 
					shininess 0.2 
					specularColor 0.0 0.0 0.0 
					transparency 0.0 
				} 
				texture NULL 
				textureTransform NULL 
			} 
			geometry Sphere{} 
		} 
	] 
} 
 
DEF Time TimeSensor 
{  
	startTime 100000 
	cycleInterval 5  
	loop TRUE 
} 
 
 
DEF position PositionInterpolator 
{ 
	key [0 1] 
	keyValue [-10 0 0,10 0 0] 
} 
 
ROUTE Time.fraction_changed  TO  position.set_fraction 
ROUTE position.value_changed  TO  ball.translation 
ROUTE Touch.touchTime TO Time.startTime