#VRML V2.0 utf8

Viewpoint {
  position 2 2 2
  orientation -0.590285 0.769274 0.244504 0.987861
  fieldOfView 0.785398
  description "ViewPoint 1"
}

NAME neutral PhBXYZSpectrum {xyz 1 1 1}

NAME red PhBXYZSpectrum { xyz   0.514145 0.265106 0.024101    }
NAME green PhBXYZSpectrum { xyz   0.323884 0.670106 0.122853    }
NAME blue PhBXYZSpectrum { xyz    0.161971 0.064788 0.853047   }

NAME DiffRed PhBHomogeneousSurface {
   bsdf PhBSimpleBSDF {
      intensity .5
      spectrum USE red
      scatterer PhBDiffuseReflector {}
   }
}

NAME DiffBlue PhBHomogeneousSurface {
   bsdf PhBSimpleBSDF {
      intensity .5
      spectrum USE blue
      scatterer PhBDiffuseReflector {}
   }
}

NAME Light PhBHomogeneousSurface {
   edf PhBEDF {
      intensity 10000.   		# [lux]
      spectrum USE neutral
      emitter PhBDiffuseEmitter { }
   }
}



NAME TextMap PhBTexturedSurface {
   texture PhBNoiseTexture { k .05 }
   surfaces [ USE DiffRed, USE DiffBlue ]
   textureProjection PhBSphereTextureProjection {}
}

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



Transform {
   children [ Shape {
      geometry Sphere { }
      appearance PhBAppearance {
	 surface USE TextMap
      }
   },
      Transform {                  # first light
	 translation 10 5 5           
	 children Shape {
	    geometry QuadFace { points 
	  [ -1  1 -1
	    -1 -1 -1
	    -1 -1  1
	    -1  1  1 ]
      }
	    appearance PhBAppearance {
	       surface USE Light
	    }
	 }
      }
  ]
}

