Normal Interpolator Example


  Transform {
     rotation  0 1 0 2.09
     children [
        DirectionalLight {
           ambientIntensity 0.75
        }
        DEF NORINT NormalInterpolator {
           key [0, 0.25, 0.5, 0.75, 1]
           keyValue [   0 0 1, 1 0 0, 0 0 -1, -1 0 0,
                 1 0 0, 0 0 -1, -1 0 0, 0 0 1,
                 0 0 -1, -1 0 0, 0 0 1, 1 0 0, 
                 -1 0 0, 0 0 1, 1 0 0, 0 0 -1, 
                 0 0 1, 1 0 0, 0 0 -1, -1 0 0 ]
        }
        Transform {
           translation 0 0.5 -10
           children [
              Shape {
                 appearance Appearance {
                    material Material {
                       emissiveColor 1 1 1
                    }
                 }
                 geometry Text {
                    string ["NormalInterpolator"]
                    fontStyle FontStyle {
                       justify "MIDDLE"
                    }
                 }
              }
           ]
        }   
        Transform {
           translation 0 3 -10
           children [
              Shape {
                 appearance Appearance {
                    material Material {
                       diffuseColor 1 0 0 
                    }
                 }
                 geometry IndexedFaceSet {
                    coord Coordinate {
                       point [ 0 1 1, 0 1 -1, -1 -1 0, 1 -1 0]
                    }
                    coordIndex [   2 3 0 -1,
                          2 0 1 -1,
                          3 2 1 -1,
                          3 1 0 -1 ]
                    normal DEF NORTGT Normal {
                       vector [   0 0 1,
                          1 0 0,
                          0 0 -1,
                          -1 0 0]
                    }
                    normalPerVertex TRUE
                    normalIndex [ 0 1 2 -1, 1 2 3 -1, 2 3 0 -1, 3 0 1 -1 ]
                 }
              }
           ]
        }
     ]
  }