VRML : Chemistry in VRML
Source code for example 3 : An s orbital.


#VRML V1.0 ascii

Separator {

#Create Lights, Camera and material as before

	DirectionalLight { direction 0 0 -1 }
	DirectionalLight { direction 0 -1 0 }
	PerspectiveCamera { 
		position 8 2 8
		orientation 0 1 0 0.7853
	}
	Material {
		diffuseColor 0 1 0
		ambientColor 0 0.2 0
	}

#DEFine "gaxis" as a long thin cylinder, representing an
#axis of the world.  This one is the y axis

	DEF gaxis Cylinder { 
		height 10 
		radius 0.1
	}
	Separator {

#Rotate around the origin, so y axis lies where x axis used
#to be.  USE "gaxis", the DEFined axis

		Rotation { rotation 0 0 1 1.570796 }
		USE gaxis

#Rotate so that y axis lies on old z axis, and repeat

		Rotation { rotation 1 0 0 1.570796 }
		USE gaxis
	}

#Define new material, and draw a Sphere

	Material {
		diffuseColor 0 0 1
		ambientColor 0 0 0.2
	}
	Sphere { radius 2 }
}


#End of File



Previous Topic (Chemistry in VRML)
Back to the VRML Reference
Back to the Main Page

©Tom Thurston, 1997
Please feel free to use and redistribute this NONcommercially!