I can’t seem to figure out how to draw 3D objects into an FBO correctly, with an orbiting camera. I am using the newer version of OF from github, which now has ofCamera and ofFBO in the core. I know it is under development.
My Fbo is smaller than the screen size of the app. I Am moving the camera around and its is not working inside of the fbo begin() end() calls. I think that I need to set some type of set camera width and height properties.
Any help or direction would be greatly appreciated.
some sample code
cam.begin();
ofSetColor(255, 0, 0, 255);
if(bUseFbo) {
fbo.begin();
ofClear(0, 0, 0, 1);
}
if(bScale) {
ofPushView();
glScalef(.25, .25, .25);
}
ofSetColor(255, 0, 0);
ofBox(boxLoc.x, boxLoc.y, boxLoc.z, 100);
if(bScale) ofPopView();
if(bUseFbo) fbo.end();
cam.end();
if(bUseFbo) {
ofSetColor(0, 0, 0);
ofRect(10, 10, fbo.getWidth(), fbo.getHeight());
ofSetColor(255, 255, 255, 255);
fbo.draw( 10, 10 );
}
http://nickhardeman.com/labs/OF-Forum-Attach/3D-Camera-FBO.zip