#VRML V2.0 utf8

# unit neutral color
DEF neutral PhBLxySpectrum { xy 0.333333 0.333333 }

# physically based light source appearance
DEF Light PhBAppearance {
  surface PhBSurface {
    edf                [ PhBDiffuseEmitter { } ]
    edfSpectralBasis   [ USE neutral ]
    edfSpectralWeights [ 10000. ]		# 10000 lux
  }
}

# unit red color
DEF red PhBLxySpectrum { xy 0.6400 0.3300 }

# diffuse red appearance
DEF DiffuseRed PhBAppearance {
  surface PhBSurface {
    bsdf                [ PhBDiffuseReflector { } ]
    bsdfSpectralBasis   [ USE red ]
    bsdfSpectralWeights [ 0.8 ]
  }
}

# unit blue color
DEF blue PhBLxySpectrum { xy 0.1500 0.0600 }

# shiny blue appearance
DEF ShinyBlue PhBAppearance {
  surface PhBSurface {
    bsdf                [ PhBDiffuseReflector { } ,
	                  PhBPhongReflector { sharpness 20. } ]
    bsdfSpectralBasis   [ USE blue, 
	                  USE neutral ]
    bsdfSpectralWeights [ 0.2
                          0.6 ]
  }
}

Group {
  children [
    Transform {		      # First child: - a light source
      translation 0 0 10
      children [
        Shape {
          geometry Sphere { radius 0.1 }
          appearance USE Light
        }
      ]
    }

    Transform {               # Second child - a diffuse red sphere
      translation 3 0 1
      children [
        Shape {
          geometry Sphere { radius 2.3 }
          appearance USE DiffuseRed
        }
      ]
    }

    Transform {               # Third child - a shiny blue box 
      translation -2.4 .2 1
      rotation     0 1 1  .9
      children [
        Shape {
          geometry Box {}
          appearance USE ShinyBlue
        }
      ]
    }

  ] # end of children for world
}
