user1026134
user1026134

Reputation: 261

OpenFrameworks Brush Tool Implementation

I am working on Open Frameworks.

I have made an application that extracts the face of the user from the live feed and projects it on a rectangle of chosen colour. Now I want the user to be able to draw something in the background of the face. To do that I need to implement a brush tool.

Problems faced:

  1. If I set the ofSetBackgroundAuto() to false, the face does not refresh from the next frame.
  2. If ofSetBackgroundAuto is set to true, then the brush doesn't draw, because the background is again and again refreshed.

Please help !!

Upvotes: 0

Views: 697

Answers (1)

underdoeg
underdoeg

Reputation: 1911

You can use a frame buffer object ofFbo https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/gl/ofFbo.h

ofFbo fbo;
setup(){
    fbo.allocate(ofGetWidth(), ofGetHeight());
}

draw(){
    fbo.begin();
    //draw your brush
    fbo.end();

    fbo.draw();

    //draw face
}

Upvotes: 1

Related Questions