From 36d4f4741cd2559362de7e64820ca4b29b022121 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sat, 7 Jan 2023 23:24:04 -0500 Subject: Initial commit --- src/noise.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/noise.hpp (limited to 'src/noise.hpp') diff --git a/src/noise.hpp b/src/noise.hpp new file mode 100644 index 0000000..c127e7f --- /dev/null +++ b/src/noise.hpp @@ -0,0 +1,32 @@ +/* + * ===================================================================================== + * + * Filename: noise.hpp + * + * Description: Defining Perlin Noise + * + * Version: 1.0 + * Created: 01/07/2023 10:52:51 PM + * Revision: none + * Compiler: gcc + * + * Author: Cara Salter (muirrum), cara@devcara.com + * Organization: + * + * ===================================================================================== + */ +#include +#include + +class PerlinNoise { + // permutation vector + std::vector p; + public: + PerlinNoise(); + PerlinNoise(unsigned int seed); + double noise(double x, double y, double z); + private: + double fade(double t); + double lerp(double t, double a, double b); + double grad(int hash, double x, double y, double z); +}; -- cgit v1.2.3