summaryrefslogtreecommitdiff
path: root/nextus/src/vectorPlugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'nextus/src/vectorPlugin.h')
-rw-r--r--nextus/src/vectorPlugin.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/nextus/src/vectorPlugin.h b/nextus/src/vectorPlugin.h
index 3d01d07..78ce06d 100644
--- a/nextus/src/vectorPlugin.h
+++ b/nextus/src/vectorPlugin.h
@@ -22,6 +22,29 @@ class vectorPanel {
size=_size;
position=_pos;
panel.setup(_title,"",_pos.x,_pos.y+size.y+5);
+
+ /*
+ float f1=-1.0;
+ float f2=1.0;
+ vector<glm::vec3> v1 = {{f1,f1,0},{f2,f1,0}};
+ vector<glm::vec3> v2 = {{f2,f1,0},{f2,f2,0}};
+ vector<glm::vec3> v3 = {{f2,f2,0},{f1,f2,0}};
+ vector<glm::vec3> v4 = {{f1,f2,0},{f1,f1,0}};
+ ofPolyline p1,p2,p3,p4;
+ p1.addVertices(v1);
+ p2.addVertices(v2);
+ p3.addVertices(v3);
+ p4.addVertices(v4);
+ frame.push_back(p1);
+ frame.push_back(p2);
+ frame.push_back(p3);
+ frame.push_back(p4);
+ */
+
+ ofPolyline p=ofPolyline().fromRectangle(ofRectangle(-1.0f,-1.0f,2.0f,2.0f));
+ p.close();
+
+ frame.push_back(p);
}
void draw(){
panel.draw();
@@ -33,7 +56,7 @@ class vectorPanel {
ofPushMatrix();
ofTranslate(size/2);
ofScale(DISPLAYSIZE.x/2.0f);
- vector<colourPolyline> lines=getOutput();
+ vector<colourPolyline> lines=clipOutput();
for (auto& line:lines){
line.draw();
}
@@ -41,7 +64,8 @@ class vectorPanel {
ofPopMatrix();
}
vector<colourPolyline> clipOutput() {
- return getOut();
+ ofLog()<<"frame has "<<frame.size()<<" paths";
+ return lineClipper::mask(getOutput(),ofRectangle(-1.0f,-1.0f,2.0f,2.0f));
};
vector<colourPolyline> getOutput() {return getLines();};
virtual vector<colourPolyline> getLines() {};