void convertInputIntoMap() { runNow = false; //creates matrix of all field types //creates matrix of distances from each pixel to another pixel of a different field type //marks down which field type that pixel is closest to, and the number itself ImageDistances setImage = new ImageDistances(); setImage.setColors(tex, width, length, pixelDistances, colorMap); if (Euclidean) { setImage.setDistancesEuclidean(pixelDistances, colorMap, fieldEdgeTypes); } else { setImage.setDistances(pixelDistances, colorMap, fieldEdgeTypes); } setImage.removeCornerPillars(pixelDistances); //Now that we know the distances to a different field type for each pixel, //we can finish up by creating the height map matrix createFloatMatrix(); setAllHeightPointsToBeBetweenZeroAndOne(); for (int smooth = 1; smooth < 3; smooth++) { //smoothHeightMapPixels (smooth); } smoothHeightMapPixels(1); //addNoise (); createTerrain(); }
void convertInputIntoMap() { string[] lines = { "Times (in ms) for image of pixel width " + width, "First Time is:", "Second Time is:", "Third Time is:", "Fourth Time is:", "Fifth Time is:" }; runNow = false; //creates matrix of all field types //creates matrix of distances from each pixel to another pixel of a different field type //marks down which field type that pixel is closest to, and the number itself ImageDistances setImage = new ImageDistances(); setImage.setColors(tex, width, length, pixelDistances, colorMap); print("starting Timer"); timer.Start(); setImage.setDistances(pixelDistances, colorMap, fieldEdgeTypes); lines[1] += " " + timer.ElapsedMilliseconds; pixelDistances = new float[width, length]; fieldEdgeTypes = new int[width, length]; timer.Reset(); timer.Start(); setImage.setDistances(pixelDistances, colorMap, fieldEdgeTypes); lines[2] += " " + timer.ElapsedMilliseconds; pixelDistances = new float[width, length]; fieldEdgeTypes = new int[width, length]; timer.Reset(); timer.Start(); setImage.setDistances(pixelDistances, colorMap, fieldEdgeTypes); lines[3] += " " + timer.ElapsedMilliseconds; pixelDistances = new float[width, length]; fieldEdgeTypes = new int[width, length]; timer.Reset(); timer.Start(); setImage.setDistances(pixelDistances, colorMap, fieldEdgeTypes); lines[4] += " " + timer.ElapsedMilliseconds; pixelDistances = new float[width, length]; fieldEdgeTypes = new int[width, length]; timer.Reset(); timer.Start(); setImage.setDistances(pixelDistances, colorMap, fieldEdgeTypes); lines[5] += " " + timer.ElapsedMilliseconds; setImage.removeCornerPillars(pixelDistances); System.IO.File.WriteAllLines(@"C:\Users\Daleb\Desktop\WriteLines.txt", lines); }