CodingTrain / CodingTrain/Suggestion-Box
[Challenge] Tileable 2D Noise (2D Polar Noise)
- Dominant language
- No language data
- Stars
- 570
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
# Challenge: Tileable 2D Noise (2D Polar Noise)
Hi @shiffman, after seeing your video about **polar noise** ([Coding Challenge #136.1: Polar Perlin Noise Loops](https://www.youtube.com/watch?v=ZI1dmHv3MeM)), where the end of a line matches the start, I've decided to make an Library to help making tileable noise that can be used to make seamless looping textures.
### Here's the link, and an example: [TileableNoise.js](https://github.com/DaviAMSilva/TileableNoise.js)

So, I think this could make a awesome coding challenge, because most of the code can be copied over from that polar noise video, or even if you want, from my library, and this can really be useful for some people.
The technical part is really simple, you only need to make two circles from two angles given by the two Cartesian coordinates of the point you're calculating the noise. Then you can simply use the 4 coordinates of the 2 circles in a 4D noise space and voilà, you have tileable 2D noise. Unfortunately *you will need an 4D noise function to do that*.
### Here's an example code:
```
let angle1 = "Relative to x position";
let angle2 = "Relative to y position";
let X = r * cos(angle1);
let Y = r * sin(angle1);
let Z = r * cos(angle2);
let W = r * sin(angle2);
return noise4D(X, Y, Z, W);
```
**Btw, I love your videos.**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.