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
// | |
// Event.h | |
// | |
// Created by Morten Nobel-Jørgensen on 8/18/13. | |
// Copyright (c) 2013 morten. All rights reserved. | |
// Open Source under New BSD License (http://opensource.org/licenses/BSD-3-Clause) | |
#pragma once | |
#include <iostream> |
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
// Simple oldskool "plasma effect", a bunch of combined sine waves | |
// input x,y (uv-coordinates), t (time) | |
int vv = int( | |
(127.0f + (127.0f * sinf(x/7.0f+t))) + | |
(127.0f + (127.0f * sinf(y/5.0f-t))) + | |
(127.0f + (127.0f * sinf((x+y)/6.0f-t))) + | |
(127.0f + (127.0f * sinf(sqrtf(float(x*x + y*y))/4.0f-t))) | |
) / 4; |
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
#define RAND48_SEED_0 (0x330e) | |
#define RAND48_SEED_1 (0xabcd) | |
#define RAND48_SEED_2 (0x1234) | |
#define RAND48_MULT_0 (0xe66d) | |
#define RAND48_MULT_1 (0xdeec) | |
#define RAND48_MULT_2 (0x0005) | |
#define RAND48_ADD (0x000b) | |
unsigned short _rand48_seed[3] = { |
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
#include <string> | |
#include <array> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
// assumes that values returned by data is normalized between 0.0 and 1.0 | |
string get_grayscale_image(int width, int height, function<float(int,int)> data){ | |
const int size = 10; |
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
// from https://code.google.com/p/googletest/source/browse/trunk/include/gtest/internal/gtest-internal.h | |
#pragma once | |
#include <ctype.h> | |
#include <float.h> | |
#include <string.h> | |
#include <iomanip> | |
#include <limits> | |
#include <set> |
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
// | |
// Created by Morten Nobel-Jørgensen on 06/05/14. | |
// Copyright (c) 2014 Morten Nobel-Joergensen. All rights reserved. | |
// | |
#include "ObjFile.h" | |
#include <fstream> | |
#include <sstream> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
/* If using gl3.h */ | |
/* Ensure we are using opengl's core profile only */ | |
#define GL3_PROTOTYPES 1 | |
#include <OpenGL/gl3.h> | |
#include <iostream> | |
#include <SDL2/SDL.h> |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Simple space partition algorithm which stores two Z planes and swaps between these two planes | |
/// </summary> |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class TRIANGLE { | |
public Vector3[] p = {Vector3.zero,Vector3.zero,Vector3.zero}; | |
} | |
public class GRIDCELL { | |
public Vector3[] p = {Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero}; |
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
#include <iostream> | |
#include <chrono> | |
using namespace std; | |
// Based on http://stackoverflow.com/a/5524138/420250 | |
int main() | |
{ | |
typedef std::chrono::high_resolution_clock Clock; | |
using FpMilliseconds = std::chrono::duration<float, std::chrono::milliseconds::period>; |