diff options
Diffstat (limited to 'ofxHelios/example')
| -rwxr-xr-x | ofxHelios/example/bin/example.app/Contents/MacOS/example | bin | 11690516 -> 11696052 bytes | |||
| -rw-r--r-- | ofxHelios/example/obj/osx/Release/src/ofApp.o | bin | 33912 -> 49548 bytes | |||
| -rw-r--r-- | ofxHelios/example/src/ofApp.cpp | 46 |
3 files changed, 31 insertions, 15 deletions
diff --git a/ofxHelios/example/bin/example.app/Contents/MacOS/example b/ofxHelios/example/bin/example.app/Contents/MacOS/example Binary files differindex a4f6d56..a6be470 100755 --- a/ofxHelios/example/bin/example.app/Contents/MacOS/example +++ b/ofxHelios/example/bin/example.app/Contents/MacOS/example diff --git a/ofxHelios/example/obj/osx/Release/src/ofApp.o b/ofxHelios/example/obj/osx/Release/src/ofApp.o Binary files differindex 1dc0536..b1b70cf 100644 --- a/ofxHelios/example/obj/osx/Release/src/ofApp.o +++ b/ofxHelios/example/obj/osx/Release/src/ofApp.o 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); + } |
