float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MATH_UNSIGNED_H | |
#define MATH_UNSIGNED_H | |
#include <cstdint> | |
#include <vector> | |
#include <iostream> | |
#include <stdexcept> | |
#include <algorithm> | |
#include <sstream> | |
#include <cctype> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Function that handles the drawing of a circle using the triangle fan | |
* method. This will create a filled circle. | |
* | |
* Params: | |
* x (GLFloat) - the x position of the center point of the circle | |
* y (GLFloat) - the y position of the center point of the circle | |
* radius (GLFloat) - the radius that the painted circle will have | |
*/ | |
void drawFilledCircle(GLfloat x, GLfloat y, GLfloat radius){ |