From 7c50a03c5857310aa383b1ba89a18792c96724b1 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 2 Feb 2018 01:47:51 +0000 Subject: lots --- nditest/src/ofApp.cpp | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 nditest/src/ofApp.cpp (limited to 'nditest/src/ofApp.cpp') diff --git a/nditest/src/ofApp.cpp b/nditest/src/ofApp.cpp new file mode 100644 index 0000000..e8e6422 --- /dev/null +++ b/nditest/src/ofApp.cpp @@ -0,0 +1,128 @@ +#include "ofApp.h" + +//-------------------------------------------------------------- +void ofApp::setup() +{ + ofSetLogLevel(OF_LOG_NOTICE); + ofBackground(ofColor::black); + + NDI.init(); + int framenum=0; +} + +//-------------------------------------------------------------- +void ofApp::exit() +{ + NDI.stopThread(); +} + +//-------------------------------------------------------------- +void ofApp::update() +{ + +} + +ofPolyline ofApp::polyLineTransform(const ofPolyline& poly, ofMatrix4x4 xform){ + ofPolyline tempPoly; + for (auto& p:poly){ + tempPoly.addVertex(ofVec3f(p)*xform); + } + return tempPoly; +} + +ofPolyline ofApp::makePolygon(int num,float diam){ + ofPolyline poly; + float step=PI*2/num; + for (int i=0;i<=num;i++){ + poly.addVertex(cos(step*i)*diam,sin(step*i)*diam); + } + return poly; +} + +void ofApp::drawPoly(ofPolyline poly,float x,float y){ + glPushMatrix(); + ofTranslate(x,y); + poly.draw(); + for (int i=0;i