<div>Hi Dave,</div><div><div><br></div><div>One of the purpose of the osgRecipes project is to provide all source code used in the book OpenSceneGraph 3.0 Cookbook, published by Packt Publishing. And what you found is just corresponding to the second example in Chapter 5. And it should be a mistake... The correct code snippet, as shown in the book, is as below:</div><div><span lang="EN-US" style="font-size:11.0pt;mso-bidi-font-size:
12.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family:ËÎÌå;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA">image = osgDB::readImageFile(
"0.ffmpeg", new osgDB::Options("format=vfwcap
frame_rate=25") );</span></div><div><br></div><div>It in fact uses the FFmpeg plugin to load video stream from the webcam using the VFW option. You may change the filename to some other disk files like "c:/path/file.avi.ffmpeg" and then ignore the option string. But there is no "animate PNG" support in OSG... so sorry for the misdirection. :-)</div><div><br></div><div>Also thank you for supporting the osgRecipes project.</div><div><br></div><div>Wang Rui</div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "Dave Sargrad";<davidsargrad@hotmail.com>;</div><div><b>Date: </b> Wed, Apr 15, 2015 05:42 AM</div><div><b>To: </b> "osg-users"<osg-users@lists.openscenegraph.org>; <wbr></div><div></div><div><b>Subject: </b> [osg-users] OSG RECIPES Data</div></div><div><br></div>Hi,<br><br>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.<br><br><br>Code:<br> osg::ref_ptr<osg::Image> image;<br> if ( arguments.argc()>1 )<br> image = osgDB::readImageFile( arguments[1] );<br> else<br> {<br>#ifdef WIN32<br> image = osgDB::readImageFile( "Images/bouncing_beach_ball.png" );<br>#else<br> image = osgDB::readImageFile( "/dev/video0.ffmpeg" );<br>#endif<br> }<br> <br> osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>( image.get() );<br> if ( imageStream ) imageStream->play();<br><br><br><br>I've never used animated png's before so I'm not sure how best to find a compatible image.<br><br>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).<br><br>Thank you for any insights.<br><br>Cheers,<br>Dave<br><br>------------------<br>Read this topic online here:<br>http://forum.openscenegraph.org/viewtopic.php?p=63394#63394<br><br><br><br><br><br>_______________________________________________<br>osg-users mailing list<br>osg-users@lists.openscenegraph.org<br>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org<br></div>