Hi,

I did a example to load video. But here it is playing correctly in the center 
of the screen. Here I used camera manipulator as TrackballManipulator().
But in project (as given above) i am not using TrackballManipulator(). If I 
used TrackballManipulator() then the 3D models are out of screen. 

Can you please help me what settings i need to set to get the video correctly 
on to the screen.

In the exaple program my transformation matrix is empty. That is I am not doing 
any operatins on transformation matrix. If I do the same on my project then the 
video is out of screen. 

And in example program the video is repeated (looping) automatically. But in my 
project it is not and giving error "no frames" when reaches to the end.

Can you please help me what to do

Here is my example program


Code:
        void main()
        {
        osg::ref_ptr<osg::ImageStream> mImageStream;
        //osg::ref_ptr<osg::Texture> mVideoTexture;
        osg::ref_ptr<osg::Texture2D> mVideoTexture;
        osg::ref_ptr<osg::Geode> mVideoGeode;
        osg::ref_ptr<osg::Geode> geode = new osg::Geode;
        osg::Image* img;

        img = osgDB::readImageFile("C:\\Test\\ar352wa.mp4.ffmpeg");
        mImageStream = dynamic_cast<osg::ImageStream*>(img);
        mVideoTexture = new osg::Texture2D;
        mVideoTexture->setImage( mImageStream.get() );


        geode->addDrawable(osg::createTexturedQuadGeometry(
                        osg::Vec3(0, 0, 0), 
                        osg::Vec3(videoWidth, 0, 0), 
                        osg::Vec3(0, 0, videoHeight) 
                        ));
        geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, 
mVideoTexture, osg::StateAttribute::ON );
        osg::MatrixTransform *    transformation = new osg::MatrixTransform();  
        transformation->addChild(geode.get());
        mImageStream->play();
        osgViewer::Viewer viewer;
        viewer.setCameraManipulator(new osgGA::TrackballManipulator());
        viewer.setUpViewInWindow (200, 200, 600, 600);
        viewer.setSceneData( transformation );
        while(!viewer.done())
        {

        viewer.frame();
        }
}



... 

Thank you!

Cheers,
Koduri

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47654#47654




_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to