Ejemplo n.º 1
0
void SecondCamera::setFromOtherCamera(ofCamera& other)
{
	setFarClip(other.getFarClip());
	setNearClip(other.getNearClip());
	setFov(other.getFov());
	
	matProjection = other.getProjectionMatrix();
	matModelView = other.getModelViewMatrix();
	
	matModelView.postMultTranslate(-_offset);
	
	isActive = true;
}
Ejemplo n.º 2
0
 void PostProcessing::begin(ofCamera& cam)
 {
     // update camera matrices
     cam.begin();
     cam.end();
     
     raw.begin(false);
     
     glMatrixMode(GL_PROJECTION);
     glPushMatrix();
     glLoadMatrixf(cam.getProjectionMatrix(ofRectangle(0, 0, width, height)).getPtr());
     
     glMatrixMode(GL_MODELVIEW);
     glPushMatrix();
     glLoadMatrixf(cam.getModelViewMatrix().getPtr());
     
     glViewport(0, 0, raw.getWidth(), raw.getHeight());
     
     glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
 }
Ejemplo n.º 3
0
 void PostProcessing::begin(ofCamera& cam)
 {
     // update camera matrices
     cam.begin();
     cam.end();
     
     raw.begin(ofFboBeginMode::NoDefaults);
     
     ofMatrixMode(OF_MATRIX_PROJECTION);
     ofPushMatrix();
     ofLoadMatrix(cam.getProjectionMatrix(ofRectangle(0, 0, width, height)));
     
     ofMatrixMode(OF_MATRIX_MODELVIEW);
     ofPushMatrix();
     ofLoadMatrix(cam.getModelViewMatrix());
     
     ofViewport(0, 0, raw.getWidth(), raw.getHeight());
     
     glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
     
     ofPushStyle();
     glPushAttrib(GL_ENABLE_BIT);
 }