info-inventor-dev
[Top] [All Lists]

RE: SoXtFullviewer and SoOffscreenRenderer

To: 'Christoph Hintermüller' <hinzge@xxxxxxxxxxxxxx>, info-inventor@xxxxxxxxxxx, info-inventor-dev@xxxxxxxxxxx
Subject: RE: SoXtFullviewer and SoOffscreenRenderer
From: "Page, Eric" <Eric.Page@xxxxxxxxxx>
Date: Fri, 21 Sep 2001 11:06:40 -0400
Sender: owner-info-inventor-dev@xxxxxxxxxxx
Yes it does work.

I am using TGS Inventor 2.6 and 3.0 on Windows

Make sure that you get the viewer's whole scene graph
viewer->getSceneManager()->getSceneGraph() to get the
draw style, camera, headlight, etc.

This is the way that I do what you are doing:

writeJPEGPicture(char* filename)
{
    FILE* outfile = fopen(filename, "wb");

    if (outfile) {
        SoOffscreenRenderer* offscreen = new
SoOffscreenRenderer(viewer->getGLRenderAction());
        SoNode* rootNode = viewer->getSceneManager()->getSceneGraph();
        SbColor col = viewer->getBackgroundColor();
        offscreen->setBackgroundColor(col);
        offscreen->render(rootNode);
        renderOffscreen(getWholeSceneGraph());
        offscreen->writeToJPEG(outfile);
        fclose(outfile);
    }
}

-----Original Message-----
From: Christoph Hintermüller [mailto:hinzge@xxxxxxxxxxxxxx]
Sent: Friday, September 21, 2001 6:45 AM
To: info-inventor@xxxxxxxxxxx; info-inventor-dev@xxxxxxxxxxx
Subject: SoXtFullviewer and SoOffscreenRenderer


Hi

I have the following problem
I want to print the content of the actual viewer to a file in 
postscript/Jpeg/tiff/rgb format and later on it should also be possible to
feed 
a mpeg or avi encoder lib  directly.

While looking through the Books and References arround Inventor I cam
accross 
the SoOffscreenRenderer and tried to implement the example'S given there.


But all i get is an image taken form the far infinty showing most of the 
background of the vierwer and the scene, which is at least filling the
viewer if 
not even zoomed, looks like a verry tiny icon on a vast desktop.

I'v allready tried to adf a furhter camera(copy of the viewers camera) to
the 
Rootnode(viewers root passed to the Offscreen renderer) and i tried to use
the 
viwers SoGlRenderAction instead of the one of the OffscreenRenderer  i
played 
with the resoltuions ....
but all i get is the same in all formats ...


So can I use SoOffscreenRenderer at all to generate fileoutput in the
mentioned
Formats from/alike the Viewer content or do I have to use something
different.


Is there something special to consider ....

cu
Christoph

-- 
THESIS:     God is alive
PROOVE:     Who else would have scheduled the mankind and world first
             recommendation of research????
CONCLUSION: Scientists do what he wants, willing or not:)

<Prev in Thread] Current Thread [Next in Thread>