Metropoli BBS
VIEWER: stars.vxr MODE: TEXT (ASCII)
#VRML V1.0 ascii

Separator {
	# Options: ON OFF AUTO
	renderCulling AUTO
	
	OUTPUT_TO Stars.wrl
	
	DEF BackgroundColor Info {
		string  ".1 .2 .7"
	}
	
	PerspectiveCamera {
		position 0 100 300
		orientation =PointAt(0,10,0)
		focalDistance 1000
		heightAngle 45'deg
	}
	
	DECLARE stars:point 1000
	
	Separator {
		Material {
			diffuseColor =Color("white")
		}

		DEF stars Coordinate3 {
			point [] # MFVec3f
		}
			
		PointSet {
			startIndex 0
			numPoints -1
		}
	
		# Create a star field on the upper half of a sphere
		DEF loop LOOP {
			fields [ SFFloat start, SFFloat end, SFFloat step, SFFloat position,
			SFFloat phi, SFFloat theata ]
			start 1
			end 1000
			step 1
	
			SET loop:theata rand()*2*pi()
			SET loop:phi rand()*pi()
			
			APPEND stars:point (10000*cos(theata)*sin(phi),10000*sin(theata)*sin(phi),10000*cos(phi))
		}
	}
	
	Material {
		diffuseColor =Color("gray")
	}
	
	Separator {

		Translation {
			translation 0 -10 0
		}

		Cylinder {
			parts ALL
			radius 200
			height 20
		}
	}
	
	Material {
		diffuseColor =Color("darkgray")
	}

	# Create a ring of blocks
	LOOP {
		fields [ SFFloat start, SFFloat end, SFFloat step, SFFloat position,
		SFFloat radius, SFFloat size	 ]
		start 0
		end 360'deg
		step 30'deg
		radius 100
		size radius*atan(step/2)

		Separator {
			# Options: ON OFF AUTO
			renderCulling AUTO
			
			Transform {
				translation radius*cos(position) stone:height/2 radius*sin(position)
				rotation 0 1 0 -position
			}
		
			DEF stone Cube {
				width size/2
				height 2*size
				depth size
			}
		
		}
	}	
}
[ RETURN TO DIRECTORY ]