Hi,

it took some time to try it out, but I finally found out, that have a problem using the code below (your untested sample code..) I tried to store the current information contained in the image (just the tile I rendered) before combining the images to one bigger one.

So I  only inserted a
gi->write("testfile.jpg");
after
win->updateGL()

Unfortunately the output file is not generated. If I set the logLevel a bit higher (or lower?) I get an OpenSG warning which tells me, tha I can only store images with a bpp of at least one. If I query the image (gi ) about its bpp it tells me it has a bpp of zero. The image widths and heights seem to be ok...
Any idea what I can do to solve it?
Thanks
Desiree

Andreas Zieringer schrieb:


Hi Desiree,

I added some untested code. The size of the Grabforeground image is just the size of the viewport. The whole render window needs to be visible.

Andreas


ViewportPtr vp = your viewport

TileCameraDecoratorPtr td = TileCameraDecorator::create();
beginEditCP(td);
    td->setFullSize(width, height);
    td->setDecoratee(vp->getCamera());
endEditCP(td);

beginEditCP(vp);
vp->setCamera(td);
endEditCP(vp);

GrabForegroundPtr gf = GrabForeground::create();

ImagePtr gi = Image::create();

beginEditCP(gf);
    gf->setImage(gi);
endEditCP(gf);

beginEditCP(vp);
    vp->getForegrounds().push_back(gf);
endEditCP(vp);

// calc xstep and ystep

...

// render the tiles
for(float y=0;y<1.0;y+=ystep)
{
    int xpos = 0;
    for(float x=0;x<1.0;x+=xstep)
    {
        for(int i=0;i<td;++i)
        {
            beginEditCP(td);
                td->setSize(x, y, x+xstep, y+ystep);
            endEditCP(td);
        }
        // render scene
        win->updateGL();

        // now just combine the image in gf into a big one.
        ...
    }
}


Hi,

is there anybody who has working example code for rendering a scene on an offscreen pixmap (or ImagePtr), which has a higher resolution than the screen and the windows I am using... I guess the solution is the PassiveWindow in conjunction with the Grabforeground ? I already tried something like this some time ago, but I didn´t get it working perfectly. One problem was, that the scene was sometimes rendered without textures. Another problem is, that (at least in the "not offscreen variant") the size of the rendered image (using Grabforeground) seems to depend from the Window I am using, but I could not figure out, how the sizes are calculated from the window sizes.. So I want to try a brand new start .... I am looking for an example which works with Qt and without Glut....
Is there anybody who can help me?

Thanks
Desiree




--
_________________________________________________________________
Desiree Görrissen [ geschäftsführerin / informatikerin ] eMail: [EMAIL PROTECTED] graphiX Gesellschaft für Computergrafik, Numerik und Internetdienste mbH
Rochusstr. 230-234,  53123 Bonn, Germany
fon: +49 228 52674-0 fax: +49 228 52674-44 http://www.graphix.de
__________________________________________________________________




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to