From 60e218550dd4f584da2f6f74ffc755f5f34c20a7 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 4 Feb 2018 03:53:59 +0000 Subject: lorenzo show --- ofxHelios/src/ofxHelios.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'ofxHelios/src/ofxHelios.cpp') diff --git a/ofxHelios/src/ofxHelios.cpp b/ofxHelios/src/ofxHelios.cpp index d5bf812..9521ec2 100644 --- a/ofxHelios/src/ofxHelios.cpp +++ b/ofxHelios/src/ofxHelios.cpp @@ -17,7 +17,7 @@ we see curved on both edges betwen shapes, but not on corners int ofxHelios::draw(vector &lines,ofColor colour,int intensity){ vector output; for (auto& line:lines){ - output.push_back(line); + output.push_back(colourPolyline(line,colour)); } return draw(output,intensity); } @@ -40,8 +40,8 @@ int ofxHelios::draw(vector &lines, int intensity){ //todo: add a transform //POC - int xoffs=0x800-(ofGetWidth()/2); - int yoffs=0x800-(ofGetHeight()/2); + int xoffs=output_centre.x-(ofGetWidth()/2); + int yoffs=output_centre.y-(ofGetHeight()/2); if (device!=OFXHELIOS_NODEVICE){ while (!dac.GetStatus(device)); //timeout for this? @@ -50,6 +50,7 @@ int ofxHelios::draw(vector &lines, int intensity){ vector points; for (auto& line:lines){ + float dist=abs(prev_point.distance(line[0])); if (dist>SUBDIVIDE){ //draw blanking points if required (only between shapes) @@ -113,7 +114,12 @@ int ofxHelios::draw(vector &lines, int intensity){ } - if (HELIOS_ERROR==dac.WriteFrame(device, pps, HELIOS_FLAGS_DEFAULT, &points[0], points.size())){ + for (auto& p:points){ //hopefully avoid problems with excessive scale + p.x=min((uint16_t)0xfff,p.x); + p.y=min((uint16_t)0xfff,p.y); + } + + if (HELIOS_ERROR==dac.WriteFrame(device, pps, HELIOS_FLAGS_DEFAULT, &points[0], min(HELIOS_MAX_POINTS,(int)points.size()))){ printf("ofxHelios: write error (%i,%i,%i,%i)\n",device, pps, HELIOS_FLAGS_DEFAULT, (int)points.size()); return -1; } -- cgit v1.2.3