This file contains hidden or 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 "ofMain.h" | |
class ofApp : public ofBaseApp { | |
public: | |
ofImage img; | |
ofEasyCam cam; | |
ofSpherePrimitive sphere; | |
float zoom = 0.5; | |
float xoff = 0; | |
float yoff = 0; |
This file contains hidden or 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
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 |