Skip to content

Instantly share code, notes, and snippets.

View OllieReynolds's full-sized avatar

Ollie Reynolds OllieReynolds

  • London
View GitHub Profile
@OllieReynolds
OllieReynolds / raymarch.cpp
Last active August 29, 2015 14:26
raymarch_ascii
#include <Windows.h>
#define GLM_SWIZZLE
#include <glm/glm.hpp>
#include <ctime>
const auto WIDTH = 100;
const auto HEIGHT = 50;
const auto PALETTE = " `-_:/~|(%zr*uwJ$khOZ8W@B#M";
const auto STEP = 0.037037f;
#define GLFW_DLL
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm\mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm\gtc\quaternion.hpp>
#include <glm\gtc\matrix_transform.hpp>
#include <SOIL.h>
#include <Windows.h>
#define GLM_SWIZZLE
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include <ctime>
#include <algorithm>
#define WIDTH 80
#define HEIGHT 25
#include <fstream>
#include <deque>
#include <string>
int main() {
std::ifstream input;
input.open("C:/Users/Ollie/Desktop/Captures/Q.txt", std::ifstream::in);
std::string line;
std::deque<std::string> linesReversed;
std::string load_source(const char* filename) {
std::ifstream input{filename};
return std::string{std::istreambuf_iterator<char>(input), std::istreambuf_iterator<char>()};
}
#version 450
out vec4 frag_colour;
void main() {
frag_colour = vec4(1.0, 0.0, 0.0, 1.0);
};
// Shader sources
const GLchar* vertexSource =
"#version 150 core\n"
"in vec2 position;"
"in vec3 color;"
"out vec3 Color;"
"void main()"
"{"
" Color = color;"
" gl_Position = vec4(position, 0.0, 1.0);"
#include <iostream>
// Credit to: https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c
double CubicEaseInOut(double p) {
if (p < 0.5) {
return 4 * p * p * p;
} else {
double f = ((2 * p) - 2);
return 0.5 * f * f * f + 1;
}

Keybase proof

I hereby claim:

  • I am OllieReynolds on github.
  • I am olliereynolds (https://keybase.io/olliereynolds) on keybase.
  • I have a public key whose fingerprint is 0E46 F266 0E7D F275 36D7 F88D E3AA 9285 3717 E141

To claim this, I am signing this object:

Function Add(a As vec3, b As vec3) As vec3
Dim r As New vec3
r.x = a.x + b.x
r.y = a.y + b.y
r.z = a.z + b.z
Set Add = r
End Function