From 53081bc9c11c8399c0a6bc5fda170c3b976c41db Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 10 Oct 2003 09:41:04 +0000 Subject: [PATCH] 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. --- examples/osgcluster/osgcluster.cpp | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index b6cdc12bc..1451f7ba7 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -37,9 +37,9 @@ class CameraPacket { public: CameraPacket():_masterKilled(false) - { - _byte_order = 0x12345678; - } + { + _byte_order = 0x12345678; + } void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp) { @@ -53,21 +53,21 @@ class CameraPacket { void getModelView(osg::Matrix& matrix,float angle_offset=0.0f) { - matrix = _matrix * osg::Matrix::rotate(angle_offset,0.0f,1.0f,0.0f); + matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f); } - void checkByteOrder( void ) - { - if( _byte_order == 0x78563412 ) // We're backwards + void checkByteOrder( void ) { - swapBytes( _byte_order ); - swapBytes( _masterKilled ); - for( int i = 0; i < 16; i++ ) - swapBytes( _matrix.ptr()[i] ); - - // umm.. we should byte swap _frameStamp too... + if( _byte_order == 0x78563412 ) // We're backwards + { + swapBytes( _byte_order ); + swapBytes( _masterKilled ); + for( int i = 0; i < 16; i++ ) + swapBytes( _matrix.ptr()[i] ); + + // umm.. we should byte swap _frameStamp too... + } } - } void setMasterKilled(const bool flag) { _masterKilled = flag; } @@ -127,7 +127,12 @@ int main( int argc, char **argv ) while (arguments.read("-n",socketNumber)) ; float camera_fov=45.0f; - while (arguments.read("-f",camera_fov)) ; + while (arguments.read("-f",camera_fov)) + { + std::cout << "setting lens perspective : original "<