From cdb92d8c8532a287b752a92f1cf0cbf88d52c117 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 20 Apr 2023 22:44:47 +0100 Subject: WIP trying to clip --- nextus/src/vectorPlugin.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'nextus/src/vectorPlugin.h') 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 v1 = {{f1,f1,0},{f2,f1,0}}; + vector v2 = {{f2,f1,0},{f2,f2,0}}; + vector v3 = {{f2,f2,0},{f1,f2,0}}; + vector 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 lines=getOutput(); + vector lines=clipOutput(); for (auto& line:lines){ line.draw(); } @@ -41,7 +64,8 @@ class vectorPanel { ofPopMatrix(); } vector clipOutput() { - return getOut(); + ofLog()<<"frame has "< getOutput() {return getLines();}; virtual vector getLines() {}; -- cgit v1.2.3