| 476 | } |
| 477 | |
| 478 | std::vector<std::vector<float>> SimplexNoise::create(size_t pWidth, size_t pHeight, size_t pOctaves) { |
| 479 | |
| 480 | std::vector<std::vector<float>> result; |
| 481 | |
| 482 | for (float x = 0; x < pWidth; ++x) { |
| 483 | |
| 484 | std::vector<float> row; |
| 485 | for (float y = 0; y < pHeight; ++y) { |
| 486 | |
| 487 | row.push_back(fractalXY(pOctaves, x, y)); |
| 488 | } |
| 489 | |
| 490 | result.push_back(row); |
| 491 | } |
| 492 | |
| 493 | normalizeArray(result); |
| 494 | return result; |
| 495 | } |
| 496 | |
| 497 | |
| 498 | void SimplexNoise::normalizeArray(std::vector<std::vector<float>>& pNoise) { |