Beispiel #1
0
        public ElevationGrid BuildHeightmapFromGenerator(RenderingContext rc,
                                                         IHeightMapGenerator generator,
                                                         out Bitmap largePerlinImage,
                                                         int x, int z, int h,
                                                         float sx,
                                                         float sz)
        {
            ElevationGrid g;
            Bitmap        noiseBitmap;
            Image         newImage;

            Console.WriteLine("Rendering noise texture (in a shader)");
            noiseBitmap = largePerlinImage = generator.GenerateHeightMap(rc);

            Console.WriteLine("Processed into GDI Bitmap and cropping down to ({0}, {1}) for performace", x, z);
            newImage = noiseBitmap.GetThumbnailImage(x, z, null, IntPtr.Zero); // scale image to make processing easier
            //noiseBitmap.Dispose();
            noiseBitmap = (Bitmap)newImage;

            Console.WriteLine("Going through each depth pixel to generate an ElevationGrid");
            g = BuildHeightmapFromTexture(sx, sz, noiseBitmap, h);

            return(g);
        }
 public MultiplyHeightMap(IHeightMapGenerator a, IHeightMapGenerator b)
 {
     generatorA = a;
     generatorB = b;
 }
Beispiel #3
0
 public WindFromHeightMapParser(IHeightMapGenerator heightMapGenerator)
 {
     m_heightMapGenerator = heightMapGenerator;
 }
 public void Initialize()
 {
     hmGenerator = new PerlinHeightMap(texScale);
     SetTexture();
 }
Beispiel #5
0
 public TerrainGenerator(IHeightMapGenerator heightMapGenerator)
 {
     _heightMapGenerator = heightMapGenerator;
 }