From 4154f89b1ebff83228f51252de6b93a49fc6ed96 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sat, 3 Feb 2018 11:41:22 +0000 Subject: warping positioning interface working --- gui/src/lineTransformer.cpp | 10 ++++++++++ gui/src/lineTransformer.h | 2 ++ gui/src/ofApp.cpp | 31 +++++++++++++++++++++++++++++-- 3 files changed, 41 insertions(+), 2 deletions(-) (limited to 'gui/src') diff --git a/gui/src/lineTransformer.cpp b/gui/src/lineTransformer.cpp index a21d020..080eb9d 100644 --- a/gui/src/lineTransformer.cpp +++ b/gui/src/lineTransformer.cpp @@ -1,5 +1,6 @@ #include "lineTransformer.h" + void lineTransformer::drawWarpFrame(glm::vec2 warpframe[4]){ ofSetColor(255,255,255); ofNoFill(); @@ -97,6 +98,15 @@ ofPolyline lineTransformer::polyLineTransform(const ofMatrix4x4 xform, const ofP return tempPoly; } +colourPolyline lineTransformer::polyLineTransform(const ofMatrix4x4 xform,colourPolyline& poly){ + colourPolyline tempPoly; + for (int i=0;i warpedOutput; + vector scaledWarpedOutput; + + for (auto s:laserOutput){ + warpedOutput.push_back(lineTransformer::polyLineTransform(warp,s)); + scaledWarpedOutput.push_back(lineTransformer::polyLineTransform(scaled_warp,s)); + } + int num = 0; if (laserOutput.size()){ - num=laser.draw(laserOutput); + num=laser.draw(scaledWarpedOutput); - for (auto& shape:laserOutput){ + for (auto& shape:warpedOutput){ shape.draw(); } } -- cgit v1.2.3