- Timestamp:
- 03/25/09 00:17:05 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgstereoimage/osgstereoimage.cpp
r9124 r9967 23 23 #include <osgUtil/Optimizer> 24 24 25 #include <osg/ImageStream> 25 26 #include <osg/Geode> 26 27 #include <osg/Notify> … … 36 37 osg::Geode* createSectorForImage(osg::Image* image, osg::TexMat* texmat, float s,float t, float radius, float height, float length) 37 38 { 39 bool flip = image->getOrigin()==osg::Image::TOP_LEFT; 38 40 39 41 int numSegments = 20; … … 75 77 coords->push_back(osg::Vec3(sinf(angle)*radius,cosf(angle)*radius,-height*0.5f)); // bottom. 76 78 77 tcoords->push_back(osg::Vec2(angle/ThetaZero+0.5f, 1.0f)); // top78 tcoords->push_back(osg::Vec2(angle/ThetaZero+0.5f, 0.0f)); // bottom.79 tcoords->push_back(osg::Vec2(angle/ThetaZero+0.5f, flip ? 0.0f : 1.0f)); // top 80 tcoords->push_back(osg::Vec2(angle/ThetaZero+0.5f, flip ? 1.0f : 0.0f)); // bottom. 79 81 80 82 } … … 107 109 if (imageLeft.valid() && imageRight.valid()) 108 110 { 111 osg::ImageStream* streamLeft = dynamic_cast<osg::ImageStream*>(imageLeft.get()); 112 if (streamLeft) streamLeft->play(); 113 114 osg::ImageStream* streamRight = dynamic_cast<osg::ImageStream*>(imageRight.get()); 115 if (streamRight) streamRight->play(); 116 117 109 118 float average_s = (imageLeft->s()+imageRight->s())*0.5f; 110 119 float average_t = (imageLeft->t()+imageRight->t())*0.5f;
