Skip to content

Instantly share code, notes, and snippets.

View Joeppie's full-sized avatar

Joep Lijnen Joeppie

  • Norway
View GitHub Profile
@Joeppie
Joeppie / CameraSphere.cpp
Created January 31, 2018 15:41 — forked from kylemcdonald/CameraSphere.cpp
Unwarp an equirectangular projection into a perspective projection using openFrameworks.
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofImage img;
ofEasyCam cam;
ofSpherePrimitive sphere;
float zoom = 0.5;
float xoff = 0;
float yoff = 0;
template<class T>
T ReadAndValidate() {
T n;
cout << "enter number:";
cout.flush();
cin >> n;
while (cin.fail() == 1 || n < 0) {
cin.clear();
cin.ignore(1000, '\n'); //throw away 1000 chars, or next end of line