#VRML V2.0 utf8  

Viewpoint {
   position 0 0 10
   orientation 0 0 1 0
   fieldOfView 0.785398
   description "ViewPoint"
}
 
NAME neutral PhBXYZSpectrum { xyz 1 1 1 }
                                             
NAME light PhBHomogeneousSurface {
   edf PhBEDF {
      intensity 10000.
      spectrum USE neutral
      emitter PhBDiffuseEmitter {}
   }
}

PROTO fresnelphong [
 exposedField SFFloat s 1.
 exposedField SFNode rho NULL
 exposedField SFFloat n 10.
] {
   PhBHomogeneousSurface {
      bsdf PhBFresnelBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBPerfectSpecularReflector {}
      }
   }
}

PROTO fresnelward [
 exposedField SFFloat s 1.
 exposedField SFNode rho NULL
 exposedField SFFloat alphax 0.2
 exposedField SFFloat alphay 0.2
] {
   PhBHomogeneousSurface {
      bsdf PhBFresnelBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBWardReflector {
	    standardDeviationX IS alphax
	    standardDeviationY IS alphay
	 }
      }
   }
}

PROTO phong [
 exposedField SFFloat s 1.
 exposedField SFNode rho NULL
 exposedField SFFloat n 10.
] {
   PhBHomogeneousSurface {
      bsdf PhBSimpleBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBPerfectSpecularReflector {}
      }
   }
}

PROTO QuadFace [
 exposedField MFVec3f points [ ]
] {
   IndexedFaceSet {
      coord Coordinate {
         point IS points
      }
      coordIndex [ 0 1 2 3 ]
      colorPerVertex FALSE
      normalPerVertex FALSE
      solid FALSE
   }
}

NAME blue PhBLxySpectrum { xy 0.260000 0.260000 }

Group {
   children [
      Shape {
	 geometry Box { size -48 -24 -24 }
	 appearance PhBAppearance { 
	    surface PhBHomogeneousSurface {
	       bsdf PhBSimpleBSDF {
		  intensity 0.5
		  spectrum USE neutral
		  scatterer PhBDiffuseReflector {}
	       }
	    }
	    textureProjection PhBBoxTextureProjection { size -48 -24 -24 }
	 }
      },
      Transform {
	 translation -8 0 0
	 children [
	    Transform {
	       rotation 1 0 0 1.57
	       scale 3 1 2
	       children Shape {
		  geometry Sphere { radius 2 }
		  appearance PhBAppearance { 
		     surface fresnelward {
			s 0.5
			rho USE blue
			alphax 0.1 alphay 0.01
		     }
		     textureProjection PhBSphereTextureProjection {}
		  }
	       }
	    },
	    Transform {
	       translation 0 0 10
	       children [
		  Shape {
		     geometry QuadFace { 
			points [  0.2  0.2 0 ,
				  0.2 -0.2 0 ,
				  -0.2 -0.2 0 ,
				  -0.2  0.2 0 ]
		     }
		     appearance PhBAppearance { surface USE light }
		  }
	       ]
	    }
	 ]
      },
      Transform {
	 translation 8 0 0
	 children [
	    Transform {
#	       scale -1 -1 -1
#	       scale 1.5 1.2 1
#	       rotation 1 1 1 0
	       children  Shape {
		  geometry Cylinder { } # Sphere { radius 5 }
		  appearance PhBAppearance {
		     surface fresnelward {
			s 0.5
			rho USE blue
			alphax 0.01 alphay 0.1
		     }
		     textureProjection PhBCylinderTextureProjection { }
		  }
	       }
	    },
	    Transform {
	       translation 0 0 3
	       children [
		  Shape {
		     geometry QuadFace { 
			points [  0.2  0.2 0 ,
				  0.2 -0.2 0 ,
				  -0.2 -0.2 0 ,
				  -0.2  0.2 0 ]
		     }
		     appearance PhBAppearance { surface USE light }
		  }
	       ]
	    }
	 ]
      }
   ]
}
