()
| 42 | i += 1 |
| 43 | |
| 44 | def crossfade_height_map(): |
| 45 | for y in range(grid_hs): |
| 46 | for x in range(crossfade_range): |
| 47 | pos_i = y*grid_ws + x |
| 48 | neg_i = y*grid_ws + grid_ws - crossfade_range + x |
| 49 | weight = x/crossfade_range |
| 50 | old_pos = height_map[pos_i] |
| 51 | old_neg = height_map[neg_i] |
| 52 | height_map[neg_i] = height_map[pos_i] = weight * old_pos + (1.0 - weight) * old_neg |
| 53 | |
| 54 | |
| 55 | def _crossfade_height_map(): |