From 975c81262faa7ed06de56974064fd918a088bc1b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 18 Nov 2019 01:25:34 -0800 Subject: libs/din: add a perlin noise implementation This is a 3D noise field addressed as a unit cube. The caller supplies the resolution of the noise field in three dimensions. I've just pulled in my v3f.h here, but it probably makes sense to later on move vector headers into libs/ and share them. Later. It's called din as in noise, because it's shorter than perlin and noise. --- src/libs/din/din.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/libs/din/din.h (limited to 'src/libs/din/din.h') diff --git a/src/libs/din/din.h b/src/libs/din/din.h new file mode 100644 index 0000000..2e06072 --- /dev/null +++ b/src/libs/din/din.h @@ -0,0 +1,13 @@ +#ifndef _DIN_H +#define _DIN_H + +#include "v3f.h" + +typedef struct din_t din_t; + +din_t * din_new(int width, int height, int depth); +void din_free(din_t *din); +void din_randomize(din_t *din); +float din(din_t *din, v3f_t coordinate); + +#endif -- cgit v1.2.1