Hi Amanda,

On 26/5/09 5:39 PM, Amanda Henn wrote:
I am very new to computer graphics and OSG/OpenGL.  I need to figure out how to 
write a
simple textured rectangle to a .tif file.  I've found many examples of this but 
some
are so complicated I can't understand them.

What do you mean by 'write a texture rectangle'? Do you want to save the rendered frame to a file? If so then please take a look at the osgscreencapture example - in brief you need to add a capture callback to read the rendered frame and save it to a file.

Here is the code I have so far, when I run it I can see a single rectangle with 
the
road texture on it.  I have some code that does create a result .tif file, but 
I can't
view it.  I'm sure I'm missing some things.  I'd appreciate any help, I know 
this is
probably a simple question...

'Can't view it' as in it's empty?  Or not a tif file?
Please give us a bit more detail to work with.

//write image code I've been playing with osg::Image* resultImage = new 
osg::Image;
resultImage->allocateImage(3000, 3000, 0, GL_RGB, GL_UNSIGNED_BYTE);

osgDB::writeImageFile(*resultImage, "D:\\C++_Projects\\result.tif");

This will write an empty image (probably black).

Cheers,
/ulrich
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to