Show
Ignore:
Timestamp:
10/10/03 11:41:04 (11 years ago)
Author:
robert
Message:

Fixed the setting of the offset so that it convert degrees to radians.

Added setting of FOV, however, it doesn't yet function, will need to look into Producer to work out why.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgcluster/osgcluster.cpp

    r1960 r2371  
    3838     
    3939        CameraPacket():_masterKilled(false)  
    40     { 
    41         _byte_order = 0x12345678; 
    42     } 
     40        { 
     41            _byte_order = 0x12345678; 
     42        } 
    4343         
    4444        void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp) 
     
    5454        { 
    5555         
    56             matrix = _matrix * osg::Matrix::rotate(angle_offset,0.0f,1.0f,0.0f); 
    57         } 
    58          
    59     void checkByteOrder( void ) 
    60     { 
    61         if( _byte_order == 0x78563412 )  // We're backwards 
    62         { 
    63             swapBytes( _byte_order ); 
    64         swapBytes( _masterKilled ); 
    65         for( int i = 0; i < 16; i++ ) 
    66             swapBytes( _matrix.ptr()[i] ); 
    67                      
    68                 // umm.. we should byte swap _frameStamp too... 
    69         } 
    70     } 
     56            matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f); 
     57        } 
     58         
     59        void checkByteOrder( void ) 
     60        { 
     61            if( _byte_order == 0x78563412 )  // We're backwards 
     62            { 
     63                swapBytes( _byte_order ); 
     64            swapBytes( _masterKilled ); 
     65            for( int i = 0; i < 16; i++ ) 
     66                swapBytes( _matrix.ptr()[i] ); 
     67 
     68                    // umm.. we should byte swap _frameStamp too... 
     69            } 
     70        } 
    7171 
    7272         
     
    128128 
    129129    float camera_fov=45.0f; 
    130     while (arguments.read("-f",camera_fov)) ; 
     130    while (arguments.read("-f",camera_fov))  
     131    { 
     132        std::cout << "setting lens perspective : original "<<viewer.getLensHorizontalFov()<<"  "<<viewer.getLensVerticalFov()<<std::endl; 
     133        viewer.setLensPerspective(camera_fov,camera_fov*viewer.getLensVerticalFov()/viewer.getLensHorizontalFov(),1.0f,1000.0f); 
     134        std::cout << "setting lens perspective : new "<<viewer.getLensHorizontalFov()<<"  "<<viewer.getLensVerticalFov()<<std::endl; 
     135    } 
    131136 
    132137    float camera_offset=45.0f;