0

DS algorithm seem to require a 2D array of size 2^n + 1 (5x5, 17x17, 33x33, etc.).

My goal is to do tests with DS and another algorithm and every test need another size (so if i have 3 tests it would be like the sizes above). The crux is that i would like to do as many sizes as possible because i am creating a diagram to form a curve relative to the other algorithm. If i want this with most DS-implementations i have to use 2^n + 1 with n being natural numbers. If i do 10 tests the biggest size is already 2^10+1 = 1025x1025 which is alot in general, but the direct problem is that Unity only supports a small amount (65k verts i think) of vertices for their mesh so we cannot do alot of big sizes.

So my questions would be, is there any implementation that go around the fixed-size (or can i make adjustments on my algorithm?) or do you suggest any other smart way to solve this? I have also tried the algorithm with different numbers without the size formula (doesnt work like intended).

Nero
  • 11
  • 4
  • 1
    1. what algorithm? 2. no if you change size it will not be Diamond&Square anymore. 3. 4. May be you could do trilinear interpolation between 2 maps to obtain any square size between the two ... 5. or bilinear on single map 6. or simple cropping on single map unless you are doing special stuff like this [Diamond and Square Island generator](https://stackoverflow.com/a/36647622/2521214) – Spektre May 05 '20 at 14:49
  • The diamond square algorithm is constrained to 2^n + 1 because of it's reliance on the recursive midpoint property: https://learn.64bitdragon.com/articles/mathematics/number-theory/2%5En+1 – markt Jul 28 '20 at 10:45
  • 1
    @markt Thanks for the answer, will properly check on that link later, thx. – Nero Jul 29 '20 at 20:55

0 Answers0