info-inventor
[Top] [All Lists]

Creating a movie

To: info-inventor@xxxxxxxxxxx
Subject: Creating a movie
From: Kevin Fitch <kfitch@xxxxxxxxxxx>
Date: Thu, 30 Aug 2001 16:12:57 -0400
Sender: owner-inventor@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux 2.4.8 i686; en-US; rv:0.9.1) Gecko/20010622
I want to be able to create a movie/animation of what my program displays, so I have some code that grabs the frambuffer when I want it.
Like this:


void
Visualization::renderGL(int l,int b,int w,int h,unsigned char* buf=0) {

  SbViewportRegion vp(w+l,h+b);
  vp.setViewportPixels(l,b,w,h);
  SoGLRenderAction myRenderAction(vp);
  myRenderAction.apply(root);
  if(buf) {
    glReadBuffer(GL_BACK);
    glReadPixels(l,b,w,h,GL_RGB,GL_UNSIGNED_BYTE,buf);
  }
}

But, it seems that no matter what I get back straight 0's in buf. Is there some magical incantation to get glReadPixels to work with Inventor, or do I not understand how to use glReadPixels?

Kevin


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