-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerlin.h
47 lines (38 loc) · 1.33 KB
/
Perlin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Created by user on 2/28/2021.
//
/* Start Header -------------------------------------------------------
* Copyright (C) 2020 DigiPen Institute of Technology.
* Reproduction or disclosure of this file or its contents without the prior
* written consent of DigiPen Institute of Technology is prohibited.
* File Name: Perlin.h
* Purpose: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Language: C++, G++
* Platform: g++ (Ubuntu 9.3.0-10ubuntu2) 9.3, ThinkPad T430u, Nvidia GT 620M,
* OpenGL version string: 4.6.0 NVIDIA 390.138
* Project: Eye
* Author: Roland Shum, roland.shum@digipen.edu
* Creation date: 2/28/2021
* End Header --------------------------------------------------------*/
#ifndef EYE_PERLIN_H
#define EYE_PERLIN_H
class Perlin {
public:
Perlin();
~Perlin();
double Noise(vec3 const & p) const;
double Turbulance(vec3 const & p, int depth = 7) const;
private:
static const int point_count = 256;
double* ranfloat;
int* perm_x;
int* perm_y;
int* perm_z;
vec3 * ranvec;
static int* PerlineGeneratePerm();
static void Permute(int*p, int n);
// Deprecated
static double TrilinearInterpolate(double c[2][2][2], double u, double v, double w);
static double PerlinInterpolate(vec3 c[2][2][2], double u, double v, double w);
};
#endif //EYE_PERLIN_H