This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void exportFbo(ofFbo& _fbo) | |
{ | |
auto path = ofSystemSaveDialog("fbo.png", "save as"); | |
ofShortPixels pixels; | |
_fbo.readToPixels(pixels); | |
ofSaveImage(pixels, path.getPath()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//closest point on line | |
//http://paulbourke.net/geometry/pointlineplane/ | |
ofVec3f closestPointOnLine(ofVec3f p, ofVec3f l0, ofVec3f l1 ) | |
{ | |
if(l0 == l1) return ofVec3f(); | |
float u = (((p.x-l0.x) * (l1.x-l0.x)) + ((p.y-l0.y) * (l1.y-l0.y)) + ((p.z-l0.z) * (l1.z-l0.z))) / l1.distanceSquared( l0 ); | |
if( u < 0.0f ) | |
return l0; |
NewerOlder