#VRML V2.0 utf8  

Viewpoint {
  position 18.5539 4.52213 -0.0632036
  orientation -0.110416 0.983369 0.144202 1.85079
  fieldOfView 0.785398
  description "ViewPoint 1"
}

NAME neutral PhBXYZSpectrum { xyz 1 1 1 }
                                             
NAME light PhBHomogeneousSurface {
   edf PhBEDF {
      intensity 10000.
      spectrum USE neutral
      emitter PhBDiffuseEmitter {}
   }
}

PROTO reflector [
  exposedField SFFloat s  0.01
  exposedField SFNode rho NULL
] {
   PhBAppearance {
      surface PhBHeterogeneousSurface {
	 bsdf [ PhBFresnelBSDF {
	    intensity IS s
	    spectrum NULL
	    scatterer PhBPerfectSpecularReflector {}
	 }, PhBSimpleBSDF {
	    intensity IS s
	    spectrum IS rho
	    scatterer PhBDiffuseReflector {}
	 } ]
      }
   }
}

PROTO refractor [
  exposedField SFFloat s  0.01
  exposedField SFNode rho NULL
  exposedField SFVec2f index 1. 0.
] {
   PhBAppearance {
      surface PhBHomogeneousSurface {
	 bsdf [ 
#	       PhBFresnelBSDF {
#	    intensity IS s
#	    spectrum IS rho
#	    scatterer PhBPerfectSpecularReflector {}
#	 }, 
	       PhBSimpleBSDF {
	    intensity 1
	    spectrum IS rho
	    scatterer PhBPerfectSpecularRefractor {}
#	    scatterer PhBPhongReflector { sharpness 10 }
	 } ]
      }
      medium PhBHomogeneousMedium {
	 indexOfRefraction IS index
      }
#      textureProjection PhBSphereTextureProjection  { }
   }
}

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

NAME red PhBXYZSpectrum { xyz  0.514145 0.265106 0.024101 }
NAME blue PhBXYZSpectrum { xyz  0.161971 0.064788 0.853047 }

Group {
   children [
      Shape {
	 geometry Box { size -48 -24 -24 }
	 appearance PhBAppearance { 
	    surface PhBHomogeneousSurface {
	       bsdf PhBSimpleBSDF {
		  intensity 0.5
		  spectrum USE neutral
		  scatterer PhBDiffuseReflector {}
	       }
	    }
	 }
      },
      Transform {
	 translation -8 0 0
	 children [
	    Shape {
	       geometry Sphere { radius 5 }
	       appearance reflector {
		  s 0.1
		  rho USE red
	       }
	    },
	    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.5 1.2 1
#	       rotation 1 1 1 0.3
	       children  Shape {
#		  geometry Cylinder { height 8 radius 2 } 
#		  geometry Box { size 2 3 3 }
		  geometry Sphere { radius 1.5 }
		  appearance refractor {
		     s 0.01
		     rho USE neutral
		     index 1.5 0
		  }
	       }
	    },
	    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 }
		  }
	       ]
	    }
	 ]
      }
   ]
}
