[osg-users] OSG RECIPES Data

Dave Sargrad davidsargrad at hotmail.com
Tue Apr 14 14:42:42 PDT 2015


Hi,

I've found the osgRecipes  (https://github.com/xarray/osgRecipes) to be quite useful. However most of the data is missing from these, and there is no proper reference to the location of the data. I stumbled on this (https://github.com/openscenegraph/osg-data) data. It seems to be a close fit to the recipes. However some data files are missing. For example right now I'm in cookbook_05_02. This cookbook is looking for one of two datafiles (in my case pic.png). I think this is just a placeholder, and I'm expected to drop my own "animated PNG" into place. I've tried several such png's found on the web, but none seem to do what one might expect.


Code:
 osg::ref_ptr<osg::Image> image;
    if ( arguments.argc()>1 )
        image = osgDB::readImageFile( arguments[1] );
    else
    {
#ifdef WIN32
        image = osgDB::readImageFile( "Images/bouncing_beach_ball.png" );
#else
        image = osgDB::readImageFile( "/dev/video0.ffmpeg" );
#endif
    }
    
    osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>( image.get() );
    if ( imageStream ) imageStream->play();



I've never used animated png's before so I'm not sure how best to find a compatible image.

In this code snippet, I replaced pic.png with a bouncing_beach_ball.png found here (http://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png).

Thank you for any insights.

Cheers,
Dave

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








More information about the osg-users mailing list