openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

setLensOffset doesn't work #153

Open sphaero opened 11 years ago

sphaero commented 11 years ago

It does nothing... :(

sphaero commented 11 years ago

this is my fix:

diff --git a/libs/openFrameworks/3d/ofCamera.cpp b/libs/openFrameworks/3d/ofCamera.cpp
index c7a00b8..7ddc2ae 100644
--- a/libs/openFrameworks/3d/ofCamera.cpp
+++ b/libs/openFrameworks/3d/ofCamera.cpp
@@ -143,9 +143,10 @@ void ofCamera::begin(ofRectangle viewport) {
                ortho.makeOrthoMatrix(0, viewport.width, 0, viewport.height, nearClip, farClip);
                ofLoadMatrix( ortho );
        } else {
-               ofMatrix4x4 persp;
-               persp.makePerspectiveMatrix( fov, viewport.width/viewport.height, nearClip, farClip
-               ofLoadMatrix( persp );
+               // ofMatrix4x4 persp;
+               //persp.makePerspectiveMatrix( fov, viewport.width/viewport.height, nearClip, farCl
+               ofLoadMatrix( this->getProjectionMatrix(viewport) );
+               //ofLoadMatrix( persp );
        }

        ofSetMatrixMode(OF_MATRIX_MODELVIEW);
danzeeeman commented 11 years ago

Can you put this in a pull request? Also do you have a test app that shows how it is broken? Thanks!! On Apr 18, 2013 5:07 PM, "Arnaud Loonstra" notifications@github.com wrote:

this is my fix:

diff --git a/libs/openFrameworks/3d/ofCamera.cpp b/libs/openFrameworks/3d/ofCamera.cpp index c7a00b8..7ddc2ae 100644 --- a/libs/openFrameworks/3d/ofCamera.cpp +++ b/libs/openFrameworks/3d/ofCamera.cpp @@ -143,9 +143,10 @@ void ofCamera::begin(ofRectangle viewport) { ortho.makeOrthoMatrix(0, viewport.width, 0, viewport.height, nearClip, farClip); ofLoadMatrix( ortho ); } else {

  • ofMatrix4x4 persp;
  • persp.makePerspectiveMatrix( fov, viewport.width/viewport.height, nearClip, farClip
  • ofLoadMatrix( persp );
  • // ofMatrix4x4 persp;
  • //persp.makePerspectiveMatrix( fov, viewport.width/viewport.height, nearClip, farCl
  • ofLoadMatrix( this->getProjectionMatrix(viewport) );
  •         //ofLoadMatrix( persp );
    }
    
    ofSetMatrixMode(OF_MATRIX_MODELVIEW);

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/153#issuecomment-16610166 .