#VRML V2.0 utf8

PROTO QuadFace [
 exposedField MFVec3f points [ ]
] {
   IndexedFaceSet {
      coord Coordinate {
	 point IS points
      }
      coordIndex [ 0 1 2 3 ]
      colorPerVertex FALSE
      normalPerVertex FALSE
      solid TRUE     # enforce single sided quadrilateral
   }
}

Transform {
   translation 0 0 10
   children Shape {
      geometry QuadFace {
	 points [ 1 1 0 , 1 -1 0 , -1 -1 0 , -1 1 0 ]
      }
      appearance DEF M1 PhBAppearance {
	 surface PhBHomogeneousSurface {
	    edf PhBEDF {
	       intensity 5000000  # 20 cd / 4mm^2 = 5 10e6 cd/m^2
#	       emitter PhBDiffuseEmitter { }
	       # cos^n 17 deg = 0.5 ===> n = 15.5
	       emitter PhBPhongEmitter { sharpness 15.5 }
	    }
#	    bsdf PhBSimpleBSDF {
#	       intensity 1.
#	       scatterer PhBDiffuseReflector { }
#	    }	    
	 }
      }
   }
}

Transform {
   scale 10 10 10
   children Shape {
      geometry QuadFace {
	 points [ 1 1 0 , -1 1 0 , -1 -1 0 , 1 -1 0 ]
      }
      appearance PhBAppearance {
	 surface PhBHomogeneousSurface {
	    bsdf PhBSimpleBSDF {
	       intensity 1.
	       scatterer PhBDiffuseReflector { }
	    }
	 }
      }
   }
}
