summaryrefslogtreecommitdiff
path: root/ofxHelios/example/src/ofApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-01-29 00:50:32 +0000
committerTim Redfern <tim@getdrop.com>2018-01-29 00:50:32 +0000
commitee4db4b804443bcad410c30be88bcdce7abf6008 (patch)
tree518a7cf9be87c246acc1cff4e2c3a51111d1c782 /ofxHelios/example/src/ofApp.cpp
parent1743eab34f244a7ffff8e56d866a3e410df3bdbb (diff)
multi shapes
Diffstat (limited to 'ofxHelios/example/src/ofApp.cpp')
-rw-r--r--ofxHelios/example/src/ofApp.cpp46
1 files changed, 31 insertions, 15 deletions
diff --git a/ofxHelios/example/src/ofApp.cpp b/ofxHelios/example/src/ofApp.cpp
index e629ae0..671529b 100644
--- a/ofxHelios/example/src/ofApp.cpp
+++ b/ofxHelios/example/src/ofApp.cpp
@@ -1,8 +1,9 @@
#include "ofApp.h"
-int MAX_POINTS=30000;
-int NUM_POINTS=1024;
+int MAX_POINTS=20000;
+int NUM_POINTS=128;
int LASER_INTENSITY=37;
+int CIRCLE_RADIUS=256;
//--------------------------------------------------------------
void testApp::setup(){
@@ -12,7 +13,7 @@ void testApp::setup(){
//--------------------------------------------------------------
void testApp::update(){
- ofSetWindowTitle(ofToString(ofGetFrameRate(), 2));
+
}
@@ -47,22 +48,37 @@ void testApp::draw(){
float pfactor=(PI*2)/NUM_POINTS;
- colourPolyline line;
+ vector <colourPolyline> lines;
+
+ for (int k=0;k<2;k++){
+ for (int j=0;j<2;j++){
+
+ colourPolyline line;
+
+ for (int i=0;i<NUM_POINTS+1;i++){
+ line.addVertex(
+ ((cos(float(i)*pfactor)+1)*CIRCLE_RADIUS)+(ofGetWidth()/2)+(-(CIRCLE_RADIUS+200)+(k*400)),
+ ((sin(float(i)*pfactor)+1)*CIRCLE_RADIUS)+(ofGetHeight()/2)+(-(CIRCLE_RADIUS+200)+(j*400)),
+ (sin(float(i+(ofGetElapsedTimef()*30*j))*pfactor)+1)*128,
+ (sin(float(i+(ofGetElapsedTimef()*57*k))*pfactor)+1)*128,
+ (sin(float(i+(ofGetElapsedTimef()*101*(j+k)))*pfactor)+1)*128
+ );
+ }
+ lines.push_back(line);
+ line.draw();
+ }
+ }
+ int num = laser.draw(lines);
- for (int i=0;i<NUM_POINTS;i++){
- line.addVertex(
- ((cos(float(i)*pfactor)+1)*512),
- ((sin(float(i)*pfactor)+1)*512),
- (sin(float(i+(ofGetElapsedTimef()*30))*pfactor)+1)*128,
- (sin(float(i+(ofGetElapsedTimef()*57))*pfactor)+1)*128,
- (sin(float(i+(ofGetElapsedTimef()*101))*pfactor)+1)*128
- );
+ if (num>0){
+ ofSetWindowTitle(ofToString(ofGetFrameRate(), 2)+" fps laser points: "+ofToString(num));
+ }
+ else {
+ ofSetWindowTitle("laser error ");
}
- line.draw();
-
- laser.draw(line);
+
}