Skip to content

Instantly share code, notes, and snippets.

@abc00
abc00 / math_unsigned.h
Created June 5, 2019 09:44 — forked from fffaraz/math_unsigned.h
Arbitrary-precision integer arithmetic in C++
#ifndef MATH_UNSIGNED_H
#define MATH_UNSIGNED_H
#include <cstdint>
#include <vector>
#include <iostream>
#include <stdexcept>
#include <algorithm>
#include <sstream>
#include <cctype>
@abc00
abc00 / GLSL-Noise.md
Created October 28, 2015 12:18 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

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);
}
@abc00
abc00 / circles.cpp
Last active January 7, 2019 22:44 — forked from linusthe3rd/circles.cpp
The two methods used to create circles in opengl
/*
* 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){