Hi Veehmot (? Please sign with your name so we know who to address) On Thu, Feb 19, 2009 at 12:27 PM, Veehmot <[email protected]> wrote: > I'm trying to generate a streaming to get the frame of the webcam with > OpenCV. I have checked out the mpeg plugin, but I can't see how I can change > the data of a Texture2D from my code every frame. > > Any link, tutorial, accepted.
The best way to stream data to a texture is via the osg::ImageStream class that subclasses from osg::Image. In your own code subclass from osg::ImageStream to wrap up your OpenCV code that reads the image data, then set the Image's data pointer and call image dirty on the image stream. Then just attach your ImageStream object to any texture you want, the OSG will automatically download the data for you in the most efficient way (use subloading and PBO's). For examples of subclasses osg::Image have a look at the xine or quicktime plugins. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

