| 77 | } |
| 78 | |
| 79 | void BezierPathIterationApp::draw() |
| 80 | { |
| 81 | // clear out the window with black |
| 82 | gl::clear( Color( 0, 0, 0 ) ); |
| 83 | |
| 84 | // center and scale the drawing |
| 85 | gl::setMatricesWindow( getWindowSize() ); |
| 86 | gl::translate( mWindowOffset ); |
| 87 | gl::scale( mWindowScale ); |
| 88 | |
| 89 | gl::color( Color( 1.0f, 0.5f, 0.25f ) ); |
| 90 | for( auto &pathIt : mPathIters ) { |
| 91 | pathIt.mCurrentDistance += 3.0f; // move 3 units along the path |
| 92 | float newTime = pathIt.mPathCache.calcTimeForDistance( pathIt.mCurrentDistance ); |
| 93 | vec2 pos = pathIt.mPathCache.getPosition( newTime ); |
| 94 | |
| 95 | gl::drawLine( pathIt.mLastPos, pos ); |
| 96 | pathIt.mLastPos = pos; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | CINDER_APP( BezierPathIterationApp, RendererGl ) |
nothing calls this directly
no test coverage detected