| 665 | } |
| 666 | |
| 667 | vec2 objectToWindowCoord( const mat4 &modelMatrix, const ci::vec3 &coordinate ) |
| 668 | { |
| 669 | // Build the viewport (x, y, width, height). |
| 670 | vec2 offset = gl::getViewport().first; |
| 671 | vec2 size = gl::getViewport().second; |
| 672 | vec4 viewport = vec4( offset.x, offset.y, size.x, size.y ); |
| 673 | |
| 674 | // Calculate the view-projection matrix. |
| 675 | mat4 viewProjectionMatrix = gl::getProjectionMatrix() * gl::getViewMatrix(); |
| 676 | |
| 677 | vec2 p = vec2( glm::project( coordinate, modelMatrix, viewProjectionMatrix, viewport ) ); |
| 678 | |
| 679 | return p; |
| 680 | } |
| 681 | |
| 682 | void begin( GLenum mode ) |
| 683 | { |
nothing calls this directly
no test coverage detected