Original Post
I'm just getting around to making a proper fist of a perlin noise class. I aim to do 1D, 2D and 3D versions and I already have code to do the necessary interpolations.
For all 3x classes, I aim to provide a larger function to return a finished value with given number of octaves etc and also a smaller function that gives just the bare result so you get to dick around with the values as you "zoom in".
One thing I've always struggled with though is what the inital sample coordinates actually mean. For example in the 2D case would it be better to map the inputs such that a range of 0-1 spans the number of samples in each dimension? A value of 2.5 would then get wrapped to 0.5 before looking up halfway through the samples. Leaving things to just wrap by casting to int and masking off with the number of samples just seems a bit arbitrary to me.
What would the panel consider the ideal behaviour for a class like this? All comments welcome.
For all 3x classes, I aim to provide a larger function to return a finished value with given number of octaves etc and also a smaller function that gives just the bare result so you get to dick around with the values as you "zoom in".
One thing I've always struggled with though is what the inital sample coordinates actually mean. For example in the 2D case would it be better to map the inputs such that a range of 0-1 spans the number of samples in each dimension? A value of 2.5 would then get wrapped to 0.5 before looking up halfway through the samples. Leaving things to just wrap by casting to int and masking off with the number of samples just seems a bit arbitrary to me.
What would the panel consider the ideal behaviour for a class like this? All comments welcome.