Hello every one,

i want to render to fboviewport then captures the rendered image to a file i 
refered to 
http://www.mail-archive.com/[email protected]/msg08740.html 
but i still have problems

    ImagePtr fbotexi = Image::create();
    beginEditCP(fbotexi);
        fbotexi->setPixelFormat(Image::OSG_RGBA_PF);
        fbotexi->setWidth(w);
        fbotexi->setHeight(h);
        fbotexi->setDimension(2);
    endEditCP(fbotexi);
        
    TextureChunkPtr fbotex = TextureChunk::create();
    beginEditCP(fbotex);
        fbotex->setMinFilter(GL_LINEAR);
        fbotex->setMagFilter(GL_LINEAR);
        fbotex->setTarget(GL_TEXTURE_2D);
        fbotex->setInternalFormat(GL_RGBA8);
        fbotex->setImage(fbotexi);
    endEditCP(fbotex);

    beginEditCP(m_fbovp);
        m_fbovp->setSize(0, 0, w-1, h - 1);
        m_fbovp->setStorageWidth(w);
        m_fbovp->setStorageHeight(h);
        m_fbovp->setParent(m_window);
        m_fbovp->setCamera(m_orthocam);
        m_fbovp->getTextures().push_back(fbotex);
        m_fbovp->setRoot(rootNode());
        m_fbovp->setBackground(SolidBackground::create());
        m_fbovp->setReadBuffer(true);
        m_fbovp->setDirty(true);
    endEditCP(m_fbovp);

    SolidBackgroundPtr sbg = 
SolidBackgroundPtr::dcast(m_fbovp->getBackground());
    
    beginEditCP(sbg);
    sbg->setAlpha(0);
    sbg->setColor(Color3f((float)100/255,(float)100/255,(float)100/255));
    endEditCP(sbg);


    m_fbovp->render((RenderAction*)m_mgr->getAction());

    fbotexi->write("D:\\snake\\getafreelancer\\Render Image Of 3D Using 
OpenSG\\898121_3ds\\archr01_render02.png"); // the dll crashes here it creates 
the file with no real content


Thanks for advance,
Abdalla

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to