#VRML V1.0 ascii

# Check all aspects of IndexedLineSet rendering.
#
# 19990414 mortene
# 20030509 kintel

Separator {
   # Global settings.
   Coordinate3 {
      point [
       -1 1 0, -1 -1 0, 1 -1 0, 1 1 0,
       0 2 -1, -2 0 -1, 0 -2 -1, 2 0 -1,
      ]
   }
   Material {
      diffuseColor [
       1 0 0, 0 1 0, 0 0 1, 1 1 0, 1 0 1, 0 1 1, 1 1 1, 0 0 0,
       0.8 0.8 0.8, 0.8 0.8 0, 0.8 0 0.8, 0 0.8 0.8
      ]
   }

   Switch {
      whichChild -1

      DEF ils IndexedLineSet {
	 coordIndex [
	  0, 1, 2, 3, -1,
	  0, 3, 4, -1,
	  0, 5, 1, -1,
	  1, 6, 2, -1,
	  2, 7, 3, -1 ]

	 materialIndex [
	  6, 4, 3, 7, -1,
	  0, 2, 3, -1,
	  4, 2, 1, -1,
	  6, 3, 5, -1,
	  7, 6, 5, -1 ]

	 textureCoordIndex [
	  0, 1, 2, 3, -1,
	  0, 1, 2, -1,
	  0, 1, 2, -1,
	  0, 1, 2, -1,
	  0, 1, 2, -1 ]

	 normalIndex [
	  6, 4, 3, 7, -1,
	  0, 2, 3, -1,
	  4, 2, 1, -1,
	  6, 3, 5, -1,
	  7, 6, 5, -1 ]
      }

      DEF coordils IndexedLineSet {
	 coordIndex [
	  0, 1, 2, 3, -1,
	  0, 3, 4, -1,
	  0, 5, 1, -1,
	  1, 6, 2, -1,
	  2, 7, 3, -1 ]
      }

      DEF matpolylineils IndexedLineSet {
	 coordIndex [
	  0, 1, 2, 3, -1,
	  0, 3, 4, -1,
	  0, 5, 1, -1,
	  1, 6, 2, -1,
	  2, 7, 3, -1 ]
	 materialIndex [
          7,3,4,1,6
         ]
      }

      DEF matsegils IndexedLineSet {
	 coordIndex [
	  0, 1, 2, 3, -1,
	  0, 3, 4, -1,
	  0, 5, 1, -1,
	  1, 6, 2, -1,
	  2, 7, 3, -1 ]
	 materialIndex [
          7, 3, 5, 0, 3, 5, 4, 2, 1, 4, 5
         ]
      }

      DEF normpolylineils IndexedLineSet {
	 coordIndex [
	  0, 1, 2, 3, -1,
	  0, 3, 4, -1,
	  0, 5, 1, -1,
	  1, 6, 2, -1,
	  2, 7, 3, -1 ]
	 normalIndex [
          7,3,4,1,6
         ]
      }

      DEF normsegils IndexedLineSet {
	 coordIndex [
	  0, 1, 2, 3, -1,
	  0, 3, 4, -1,
	  0, 5, 1, -1,
	  1, 6, 2, -1,
	  2, 7, 3, -1 ]
	 normalIndex [
          7, 3, 5, 0, 3, 5, 4, 2, 1, 4, 5
         ]
      }
   }


   # (ROW 0) MaterialBinding
   Separator {
      MaterialBinding { value DEFAULT }
      USE ils

      Translation { translation +5 0 0 }
      MaterialBinding { value OVERALL }
      USE ils

      Translation { translation +5 0 0 }
      MaterialBinding { value PER_PART }
      USE ils

      Translation { translation +5 0 0 }
      MaterialBinding { value PER_PART_INDEXED }
      USE matsegils

      Translation { translation +5 0 0 }
      MaterialBinding { value PER_FACE }
      USE ils

      Translation { translation +5 0 0 }
      MaterialBinding { value PER_FACE_INDEXED }
      USE matpolylineils

      Translation { translation +5 0 0 }
      MaterialBinding { value PER_VERTEX }
      USE ils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_VERTEX_INDEXED }
      USE coordils

      Translation { translation +5 0 0 }
      MaterialBinding { value PER_VERTEX_INDEXED }
      USE ils
   }

   # (ROW 1) NormalBinding
   Translation { translation 0 +6 0 }
   Separator {
     Normal {
       vector [ 0 0 1, 1 0 0, 0 1 0, -1 0 0, 0 -1 0, 
                1 1 0, 1 0 1, 0 1 1, 1 1 1, 0.5 0 0, 0 0.5 0.5 ]
     }
      NormalBinding { value OVERALL }
      USE ils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_PART }
      USE ils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_PART_INDEXED }
      USE normsegils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_FACE }
      USE ils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_FACE_INDEXED }
      USE normpolylineils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_VERTEX }
      USE ils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_VERTEX_INDEXED }
      USE coordils

      Translation { translation +5 0 0 }
      NormalBinding { value PER_VERTEX_INDEXED }
      USE ils

   }

   # (ROW 5) With different ShapeStyle settings.
   Translation { translation 0 +6 0 }
   Separator {
      Translation { translation +5 0 0 }
      ShapeHints { vertexOrdering CLOCKWISE }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { vertexOrdering COUNTERCLOCKWISE }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { shapeType UNKNOWN_SHAPE_TYPE }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { shapeType SOLID }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { faceType UNKNOWN_FACE_TYPE }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { faceType CONVEX }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { creaseAngle 0.5 }
      USE ils

      Translation { translation +5 0 0 }
      ShapeHints { creaseAngle 1.57 }
      USE ils
   }

   # (ROW 6) Test how IndexedLineSet is affected by texturemapping.
   Translation { translation 0 +6 0 }
   Separator {
      Material {}
      Texture2 {
	 image 6 8 3
	 0x00ff0000 0x00ff0000 0x00000000 0x00000000 0x00ff00ff 0x00ff00ff
	 0x00ff0000 0x00ff0000 0x00000000 0x00000000 0x00ff00ff 0x00ff00ff
	 0x00ff0000 0x00ff0000 0x00000000 0x00000000 0x00ff00ff 0x00ff00ff
	 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
	 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
	 0x00ffff00 0x00ffff00 0x00000000 0x00000000 0x00ffffff 0x00ffffff
	 0x00ffff00 0x00ffff00 0x00000000 0x00000000 0x00ffffff 0x00ffffff
	 0x00ffff00 0x00ffff00 0x00000000 0x00000000 0x00ffffff 0x00ffffff
      }

      USE coordils

      TextureCoordinate2 {
        point [ 0 0, 0 1, 1 0, 1 1, 
                0.25 0.25, 0.25 0.75, 0.75 0.25, 0.75 0.75,
        ]
      }

      Translation { translation +5 0 0 }
      USE coordils

      Translation { translation +5 0 0 }
      USE ils
   }
}
