Ignore:
Timestamp:
Aug 13, 2012, 8:36:29 PM (12 years ago)
Author:
Torben Dannhauer
Message:

New Distortion setup strategy added: distortionNG can now handle configuration files of "Projection Designer"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionSetupStrategyProjectSyntropy.cpp

    r400 r410  
    1919#include <osg/Vec3d>
    2020#include <osg/ImageUtils>
     21#include <osgDB/FileUtils>
    2122#include <osgDB/ReadFile>
    2223#include <osgDB/fstream>
     
    235236        }
    236237
     238        if(     !osgDB::fileExists(_blendmapFilename) || !osgDB::fileExists(_frustumFilename) || !osgDB::fileExists(_distortionFilename) )
     239        {
     240                OSG_ALWAYS<<"DistortionSetupStrategyProjectionDesigner::delegateDistortionSetup : One of the specified input files does not exist!"<<std::endl;
     241                return;
     242        }
     243
    237244        //OSG_ALWAYS<<"drin"<<std::endl;
    238245
     
    303310               
    304311                //Frustum Parameters: Left, Right, Bottom, Top, zNear, zFar.
    305                 // Important: By definition of OpenGL, Left, Right, Bottom and Top must be set as tangens!
    306                 projectionOffset.makeFrustum(frustumValues[10], frustumValues[11], frustumValues[12], frustumValues[13], zNear, zFar);
     312                // Important: By definition of OpenGL, Left, Right, Bottom and Top must be set as tangens, multiplied by zNear!
     313                projectionOffset.makeFrustum(frustumValues[10] * zNear, frustumValues[11] * zNear, frustumValues[12] * zNear, frustumValues[13] * zNear, zNear, zFar);
    307314
    308315                distortionSet->setViewOffset(viewOffset);
Note: See TracChangeset for help on using the changeset viewer.