Hi, please forgive my english...
I'm developping an interractive application where people's movement affect the content of a 3D scene. Somewhere in the appication, when people move, planty of small insects appears and follow their hands. I modelized these insects by a small square plane on wich I apply a sequence of PNG image to give them life. I use texture rectangle to display the images. I made my own class that manage the sequence of PNG images. So when I make a call to MyOwnStreamingClass.getNextFrameToDisplay(), it returns me the next image to display. To change the image of the textureRectangle of each insect, I do the following : -- AInsectTextureRectangle.setImage( MyOwnStreamingClass.getNextFrameToDisplay() ); But this way, I got a memory leak. I tought that a call to texture.setImage would delete the last image and replace it by the new one., but it don't seems to. So I try another way to change the image : -- osg::Image* nextImage = MyOwnStreamingClass.getNextFrameToDisplay(); -- osg::Image* textureImage = AInsectTextureRectangle.getImage(); -- textureImage.setImage( ..., ..., nextImage .data(), ... ); But it doesn't work either, in fact I got a runtime error this way. So I would like too know how I should proceed ? The PNG images are of size 40x40 and a sequence is made of 100 images. I can have like 50 insects at the same time in the scene. Thanks in advance Alexandre
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org