public static IConstructionSet GetConstructionSetProvider()
        {
            IConstructionSet constructionSet   = new X3DConsructionSet();
            ElevationBuilder elevationProvider = new ElevationBuilder();

            // Makes use of whatever OpenGL context invokes this construction set

            constructionSet.ElevationBuilder = elevationProvider;

            return(constructionSet);
        }
        public static void ExecuteBuildTasks(RenderingContext rc)
        {
            Console.WriteLine("Builds an ElevationGrid given parameters outputting in X3D XML encoding");


            ElevationBuilder builder = new ElevationBuilder();
            ElevationGrid    elevation;
            X3D   root;
            Shape shape;

            //Image newImage;
            //Bitmap bmp;

            ConstructionSet.ElevationBuilder = builder;

            // Setup scene graph
            builder.BuildShapeDom(out root, out shape);

            // below are the generation options for ElevationGrid

            // builds a big chessboard
            //elevation = builder.BuildCheckerboard(100, 100, 8f, 8f, Vector3.One, new Vector3(OpenTK.Graphics.Color4.DarkGreen.R, OpenTK.Graphics.Color4.DarkGreen.G, OpenTK.Graphics.Color4.DarkGreen.B));

            // builds elevation based on a sine function:
            //elevation = builder.BuildVaryingHeightMap(100, 100, 8f, 8f, false, colorSequencer, sineGeometrySequencer);

            // build mountain
            //elevation = builder.BuildVaryingHeightMap(100, 100, 1.0f, 1.0f, false, colorSequencer, mountainGeometrySequencer);

            // build mountain from hight points in texture:
            //bmp = (Bitmap)Image.FromFile(X3DExamplesDirectory + "heightmaptest1.png");
            //bmp = (Bitmap)Image.FromFile(X3DExamplesDirectory + "heightmaptest2.jpg");
            //bmp = (Bitmap)Image.FromFile("D:\\test_frame_out.png");
            //newImage = bmp.GetThumbnailImage(100, 100, null, IntPtr.Zero); // scale image to make processing easier
            //bmp.Dispose();
            //bmp = (Bitmap)newImage;
            //elevation = builder.BuildHeightmapFromTexture(20, 20, bmp, 400.0f); // build a rather large height map

            // build mountain on the fly using perlin noise shader: (requires OpenGL 4.x)
            Console.WriteLine("Using perlin noise generator");
            elevation = builder.BuildHeightmapFromGenerator(rc, _perlin, out largePerlinImage, 40, 40, 20, 20, 20); // build a rather large height map

            outputX3D(root, shape, elevation);
        }