[osg-users] Drawing to Texture2D

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Fri Jul 11 08:39:34 PDT 2008

Hi James,

> I was wondering if it is possible to draw on a Texture2D instance. I 
> know this isn't possible, but I am wondering if you can do the 
> equivalent of:
> Texture2Dinstance->DrawCircle(x,y,r);

OSG does not do 2D drawing to images. You can do your own by getting the 
data pointer from an osg::Image and drawing pixels into that (if you 
feel the need to write your own line, circle, flood-filling etc. 
algorithms :-) ), or you can use an imaging library (ImageMagick, etc.) 
to make the image and then get the data from that library and copy it 
into an osg::Image (or perhaps even use the same pointer if it's a raw 
format). No need to save the image to disk and re-read it with OSG.

Hope this helps,

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list