www.pudn.com > vrmlExample.rar > box.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] 
} 
 
Group{   
	children  
	[   
		Shape	 
		{ 
			appearance	Appearance									{ 
				material Material  
				{  
					diffuseColor 1 0 0  
				} 
			}   
 
			geometry IndexedFaceSet 
			{   
				coord DEF ashape Coordinate 
				{ 
					point		 
					[ 
						-4 -2 0		,  
						 2 -1 0		,  
						 4  1 0		,  
						-1  3 0 	, 
				    		 2  3 0		,		 
					] 
				} 
 
				coordIndex [ 0 1 2 3 4]  
				 
				}   
			}   
 
		DEF myShape CoordinateInterpolator 
		{   
			key [ 0 0.5 1 ] 
			keyValue		 
			[ 
				-4 -2 0	,  
				 2 -1 0	,  
				 4  1 0	,  
				-1  3 0 , 
				 2  3 0	,		 
	 
				-6 -2 0	,  
				 2 -2 0	,  
				 0  0 0	,  
				-4  3 0 , 
				 0  3 0	,		 
 
				-4 -2 0	,  
				 2 -1 0	,  
				 4  1 0	,  
				-1  3 0 , 
				 2  3 0	,		 
			]   
		}   
 
		DEF timer TimeSensor 
		{  
			cycleInterval	3   
			loop		TRUE  
		}  
	]  
}   
 
 
ROUTE timer.fraction_changed	TO myShape.set_fraction   
ROUTE myShape.value_changed	TO ashape.set_point